Dancers

No attempts yetTime limit1sMemory limit128 MB

Problem

Alex missed a ballroom dance competition that he wanted to attend, so now he wants to reconstruct which pairs of dancers performed together. He has one photo of the competition in which every dancer is clearly visible, and from it he wrote down the coordinates of all N dancers (N is even).

Alex reconstructs the pairs with the following algorithm. Among the dancers that are not yet paired, he repeatedly chooses the two dancers that are closest to each other (by Euclidean distance) and assumes they form a pair. If several unpaired pairs share the same minimum distance, he chooses the lexicographically smallest pair. Dancers are numbered from 1 to N, and inside a pair the dancer with the smaller number is written first, so a pair (a,b)(a, b) always has a<ba < b; two pairs are compared first by aa and then by bb.

Help Alex determine all of the pairs.

Input

The first line contains an even integer N (2N3002 \le N \le 300).

Each of the next N lines contains two integers: the x and y coordinates of the i-th dancer. Every coordinate has absolute value less than 10810^8.

Output

Output N/2 lines, one per pair. Each line contains the two numbers of the dancers in that pair, the smaller number first. The lines must be sorted in lexicographically ascending order.