|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||256 MB||4||2||2||100.000%|
Jack somehow found N stones and arranged them in increasing order of their weights. No two weights are equal. The lightest stone is given the rank 1, the next lightest — 2, and so on, the heaviest stone gets the rank N.
He has a balance scale and decided to put all the stones on it’s sides in some order. It’s known in which order he is going to put those stones on the scale and on which side each stone gets.
You have to determine the state of scale after each stone is added. Jack doesn’t tell the exact weights of those stones.
The first line contains integer number N (1 ≤ N ≤ 100000).
Each of the next N lines contains two integer numbers: R (1 ≤ R ≤ N) and S (1 ≤ S ≤ 2). R is the rank of the next stone which is put on side S. All R’s will be distinct.
Output N lines — one for each added stone. If after adding the corresponding stone side 1 is heavier, output “<”. If side 2 is heavier, output “>”. If it’s not clear in which state the scale will be, output “?”.
5 1 2 3 1 2 1 4 2 5 1
< > > ? >