on a table
2
n
We have 2n coins.
n
n coins on top of the table with the numbers 1 to
n
n and
n
n coins at the bottom of the table with the numbers 1 to
n
n are located. We know that some (perhaps zero) coins are counterfeit, and the rest are genuine. Genuine coins together, and fake coins together, are of equal weight. We also know that the weight of fake coins is less than the weight of original coins.

Original shape

for every
i
i and
J
j, the weight of the coin
i
Cover the table with a coin from above
J
We compared from the bottom side of the table and if:

The weight of the coin
i
The higher the i, the lower the coin
J
j was down sign <
The weight of the coin
i
The higher i, the more coins
J
j was down sign >
The weight of the coin
i
i above, equal to the coin
J
j was down = sign
in the line
i
column i
J
A table
n
x
n
We have written n×n.

Now we want to determine from this table which coins are genuine and which coins are fake. There may be a contradiction in the given table or we may not be able to determine the situation uniquely with the help of this data. We want you to write a program that detects these three states and declares the result.

Read the examples to understand the question better.

input
In the first line of input, integer and positive number
n
n is given to you.
1
≤
n
≤
2
,
,
000
1≤n≤2,,000

in
n
n next line, per line
n
Given n characters, one of <, = or >. It means a coin
i
iam from
J
j is less than (<), greater than (>) or equal to (=).

output
If the given information is contradictory, the term invalid, otherwise, if we could not uniquely identify the fake or original status, the term not unique, and otherwise, in two lines, in each line a string of 0 (fake) and 1 (original).
n
Print n indicating the counterfeit or genuine status of the coins at the top and bottom of the table, respectively.

examples
Sample entry 1
4
<=<<
<=<<
=>==
<=<<
Plain text
Sample output 1
0010
1011
Plain text
Explanation of sample 1
If the weight of the above 4 coins is
u
1
,
u
2
,
u
3
,
u
4
,
u
1
​
 ,u
2
​
 ,u
3
​
 ,u
4
​
 , and the bottom 4 coins with
d
1
,
d
2
,
d
3
,
d
4
,
d
1
​
 d
2
​
 d
3
​
 d
4
​
 , show The data in the above table are as follows:

u
1
<
d
1
u
1
=
d
2
u
1
<
d
3
u
1
<
d
4
u
2
<
d
1
u
2
=
d
2
u
2
<
d
3
u
2
<
d
4
u
3
=
d
1
u
3
>
d
2
u
3
=
d
3
u
3
=
d
4
u
4
<
d
1
u
4
=
d
2
u
4
<
d
3
u
4
<
d
4
u
1
​
 <d
1
​

u
2
​
 <d
1
​

u
3
​
 = d
1
​

u
4
​
 <d
1
​

​

u
1
​
 = d
2
​

u
2
​
 = d
2
​

u
3
​
 >d
2
​

u
4
​
 = d
2
​

​

u
1
​
 <d
3
​

u
2
​
 <d
3
​

u
3
​
 = d
3
​

u
4
​
 <d
3
​

​

u
1
​
 <d
4
​

u
2
​
 <d
4
​

u
3
​
 = d
4
​

u
4
​
 <d
4
​

​


Counterfeit coins are marked in orange and genuine coins in yellow in the image below. This is the only possible mode for the coins to be fake or genuine, and the results of the comparisons show the same.

Sample figure 1

Sample input 2
3
=<<
<=<
<<=
Plain text
Sample output 2
disabled
Plain text
Explanation of sample 2
Both coins 1 (top and bottom), 2 and 3 are of equal weight. So we can weigh them with
w
1
w
1
​
 ,
w
2
w
2
​
 and
w
3
w
3
​
 to show

We know that coin 1 (top) is lighter than coin 2 (bottom).
w
1
<
w
2
w
1
​
 <w
2
​
 ). Coin 2 (top) is lighter than coin 1 (bottom).
w
2
<
w
1
w
2
​
 <w
1
​
 ). And this is a contradiction and the answer becomes invalid.

Sample entry 3
1
=
Plain text
Sample output 3
not unique
Plain text
Explanation of the sample 3
In this case, we have two coins, coin 1 up and coin 1 down, and we know that they are of equal weight. Both may be fake or both original. So their status cannot be determined uniquely and the answer is not unique.  write in c++