H. Detective Korombo
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

At the scene of a strange break-in, Korombo finds a slip of paper with cryptic clues, all pointing to a secret locker containing the key to the case. The lockers are numbered with integers from $$$-\infty$$$ to $$$+\infty$$$, and each clue gives an inequality that narrows down the possible number $$$x$$$ of the locker.

The inequalities are of the form:

$$$$$$ \texttt{x \gt a} \quad \quad \quad \texttt{x \gt = a} \quad \quad \quad \texttt{x \lt a} \quad \quad \quad \texttt{x \lt = a} $$$$$$ Your task is to help Korombo determine whether there is exactly one integer $$$x$$$ that satisfies all the clues.

Input

The first line contains a single integer $$$n$$$ $$$(1 \leq n \leq 10^5)$$$ — the number of constraints.

Each of the next $$$n$$$ lines contains a constraint in one of the following four forms:

  • > a
  • >= a
  • < a
  • <= a

Where $$$a$$$ is an integer with absolute value at most $$$10^9$$$.

Output

Print the result on a single line:

  • The unique integer $$$x$$$ satisfying all the constraints, if it exists.
  • NOT UNIQUE if multiple integers satisfy the constraints (insen).
  • IMPOSSIBLE if no integers satisfy the constraints.

The answer is case-insensitive. For example, IMPOSSIBLE, Impossible, or impossible will all be accepted.

Examples
Input
4
> 5
>= 6
< 8
<= 6
Output
6
Input
2
> 2
<= 5
Output
NOT UNIQUE
Input
2
>= 10
< 10
Output
IMPOSSIBLE