Towers

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

Benson the Rabbit likes towers. There are NN cities numbered 11 to NN, and city ii is located at a point with integer coordinates (X_i,Y_i)(X\_i , Y\_i). No two cities are located at the same point. Benson wants to build towers in some of these cities such that the following conditions are satisfied:

  • For any aa, there are at most two towers with xx-coordinate equal to aa.
  • For any bb, there are at most two towers with yy-coordinate equal to bb.
  • Each of the NN cities either has a tower built, or lies on the line segment between two towers with the same xx-coordinate or the same yy-coordinate. More formally, for a city located at (x,y)(x, y), if there is no tower in that city, then there are two towers at coordinates (x,c)(x, c), (x,d)(x, d) with cydc ≤ y ≤ d, or two towers at coordinates (e,y)(e, y), (f,y)(f, y) with exfe ≤ x ≤ f.

Benson knows that it is always possible to build towers satisfying these conditions, but does not know how he should do so. Help Benson determine where he should build the towers.

입력

Your program must read from standard input.

The first line of the input contains one integer, NN, the number of cities.

In the next NN lines, the iith line contains two integers X_iX\_i, Y_iY\_i, which means city ii is located at the point (X_i,Y_i)(X\_i , Y\_i).

출력

Your program must print to standard output.

Output one line containing a string of NN characters A_1A_2A_NA\_1A\_2 \cdots A\_N. A_iA\_i should be 11 if Benson should build a tower in city ii, and 00 otherwise. The towers built should satisfy all the conditions.

If there are several solutions your program can output any one of them.

제한

  • 1N1061 ≤ N ≤ 10^6
  • 1X_i,Y_i1061 ≤ X\_i , Y\_i ≤ 10^6
  • For all iji \ne j, either X_iX_jX\_i \ne X\_j or Y_iY_jY\_i \ne Y\_j.