Under construction

Still being built. Things may change

Aerobatics 6

Time limit1sMemory limit512 MB

Summary
Given N checkpoints in the plane, find a visiting order whose polyline has the largest possible minimum turning angle at its inner checkpoints.
Level

Hard8 of 10

Topics
Geometry, Greedy, Sorting
Solved
No attempts yet

Problem

Bitaro will take part in an aerobatics competition and fly an airplane. The airplane keeps a constant altitude and passes through checkpoints. The flight area is treated as a coordinate plane. There are NN checkpoints, numbered 1 to NN. Checkpoint ii has coordinates (Xi,Yi)(X_i, Y_i).

The flight proceeds as follows.

  1. Bitaro chooses the starting checkpoint, and the airplane takes off from there.
  2. Repeat the following N−1N-1 times. Bitaro chooses the next checkpoint from those not yet chosen. The airplane then flies straight from the current checkpoint to the next one.
  3. When the airplane reaches the last checkpoint, the flight ends.

In step 2, the starting checkpoint counts as already chosen. The airplane must fly in a straight line between checkpoints. Drawing a curve or turning in the middle of a leg is forbidden.

The route is a polygonal line. The airplane changes direction at most N−2N-2 times. At a checkpoint where the angle of the polygonal line is small, the direction change is large, which risks failing the flight.

Bitaro wants the minimum angle of the polygonal line at the N−2N-2 checkpoints other than the starting and last checkpoints to be as large as possible. Given the checkpoint coordinates, find a visiting order that maximizes this minimum angle.

Input

The first line contains NN and Z0Z_0. Z0Z_0 is a parameter used by the grader. Each of the next NN lines contains XiX_i and YiY_i.

Output

Print NN lines. The kk-th line contains PkP_k (1≤Pk≤N1 \le P_k \le N), the number of the kk-th checkpoint on the route. The starting checkpoint is P1P_1.

Constraints

  • 3≤N≤10003 \le N \le 1000
  • Xi2+Yi2≤10000000\sqrt{X_i^2 + Y_i^2} \le 10000000 (1≤i≤N1 \le i \le N)
  • (Xi,Yi)≠(Xj,Yj)(X_i, Y_i) \ne (X_j, Y_j) (1≤i<j≤N1 \le i < j \le N)
  • 1≤Z0≤1791 \le Z_0 \le 179

Examples1

  1. Example 1

    Input
    7 90
    3 1
    2 5
    0 2
    -1 6
    -3 1
    -1 -4
    4 -2
    
    Expected output
    5
    3
    1
    7
    6
    4
    2