CSES - Aalto Competitive Programming 2024 - wk10 - Wed - Zig Zag
  • Time limit: 1.00 s
  • Memory limit: 512 MB

Uolevi is bored in class and is scribbling an incoherent shape in his notebook. He keeps his pen on the paper at all times and connects dots that he drew earlier with straight lines. On each dot he is going to make at least a 9090^\circ turn to the next dot. There are nn dots numbered 1,2,,n1,2,\dots,n. The ii-th dot's position on the paper is (xi,yi)(x_i, y_i). Find a way to connect the dots in this zig-zag pattern. It can be proven that such a pattern always exists.

Input

The first line contains a single integer nn. The ii-th of next nn following lines contains two integers xix_i and yiy_i.

Output

Print the order in which the dots are connected on a single line. If there are multiple answers, print any as follows:

ans1  ans2    ansnans_1\,\,ans_2\,\,\dots\,\,ans_n

Constraints

  • 2n20002 \leq n \leq 2000
  • 1xi,yi1091 \leq x_i, y_i \leq 10^9
  • (xi,yi)(xj,yj)(x_i, y_i) \neq (x_j, y_j) if iji \neq j
  • All input values are integers.
  • 1ansin1 \leq ans_i \leq n
  • ansiansjans_i \neq ans_j if iji \neq j

Example 1

Input:

4
1 1
1 2
2 2
2 1

Output:

1 2 3 4

Example 2

Input:

6
1 4
2 1
3 6
3 4
3 3
5 1

Output:

2 4 1 3 6 5