Hop
문제
♪ Jeremiah was a bullfrog Was a good friend of mine ♪
There are n water lilies, numbered through , in a line. On the -th lily there is a positive integer , and the sequence (x_i)_{1 ≤ i ≤ n} is strictly increasing.
Enter three frogs.
Every pair of water lilies , where , must belong to frog , frog , or frog .
A frog can hop from water lily to water lily if the pair belongs to it, and divides .
Distribute the pairs among the frogs such that no frog can make more than consecutive hops.
입력
The first line contains a positive integer (1 ≤ n ≤ 1000), the number of water lilies.
The second line contains positive integers (1 ≤ x_i ≤ 10^{18}), the numbers on the water lilies.
출력
Output lines. In the -th line, output numbers, where the -th number is the label of the frog to which belongs.
힌트
Clarification of the first example:
The frogs are marked blue (1), green (2), and red (3).
The blue frog can hop from water lily to water lily , then to water lily , and then to . These are the only three consecutive hops any frog can make.
The green frog can hop from water lily to water lily , and then to , because divides , and divides . Those are two consecutive hops.
The red frog cannot hop from water lily to water lily because is not divisible by .
No frog can make more than three consecutive hops.
예제
예제 1
8 3 4 6 9 12 18 36 72
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1
예제 2
2 10 101
1