Knights of Round Table

원탁에 앉은 2N명의 기사에게 두 가지 물약을 나눠 주되, 같은 조의 두 기사는 서로 다른 물약을 마시고 연속한 세 명이 같은 물약을 마시지 않도록 배정한다.

어려움8그래프그리디구현수학아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

2N2N knights sit around a round table, they are numbered by King Arthur in clockwise order with integers from 1 to 2N2N.  Knight jj is a neighbor of knights j1j - 1 and j+1j + 1, knights 1 and 2N2N are neighbors too. The knights represent NN orders, each order is represented by exactly two knights and each knight represents exactly one order.

There are two types of magical potion today prepared by Merlin. Let's call them X and Y. Merlin wants to distribute drinks between the knights satisfying the following conditions:

  • Each knight will drink exactly one of the potions, X or Y.
  • Knights from the same order must drink different potions.
  • No three consecutive knights at the table drink the same potion.

Find any distribution which conforms with Merlin's requirements or determine that no such distribution exists

입력

The first line contains a single integer NN (2N51052 \le N \le 5 \cdot 10^5) --- the number of orders represented at the table. Each of the next NN lines describes one order and contains two integers aa and bb (1a,b2N1 \le a, b \le 2N), denoting the numbers of knights of that order at the table. All numbers in those NN lines are pairwise distinct.

출력

If there is no solution, print a single word "impossible".

Otherwise, print a single string with 2N2N characters 'X' and 'Y' describing the distribution of potions. The ii-th character must represent the selection for knight ii.

If there is more than one possible distribution, print any of them.