Circle Selection

Process circles in decreasing radius order; each chosen circle removes all remaining circles that intersect it, and for every circle you must report which chosen circle eliminated it.

Hard9GeometrySortingDivide and conquerSimulationNo attempts yetTime limit3sMemory limit1024 MB

Problem

There are nn circles c1,c2,,cnc_1, c_2, \dots, c_n on the plane. Repeat the following steps.

  1. Take the circle cic_i with the largest radius. If several circles share the largest radius, take the one with the smallest index.
  2. Remove cic_i and every circle that intersects cic_i. Two circles intersect if at least one point is contained in both of them. A point is contained in a circle if it lies inside the circle or on its border.
  3. Repeat steps 1 and 2 until no circle is left.

Drawing of the circles being removed step by step

If the circle taken in the round that removes cic_i is cjc_j, then cjc_j eliminates cic_i. The circle taken in a round is removed in that same round, so a circle can eliminate itself. For every circle, find the index of the circle that eliminates it.

Input

The first line contains the number of circles nn (1n3×1051 \le n \le 3 \times 10^5).

Each of the next nn lines contains three integers xix_i, yiy_i, rir_i, the x-coordinate, the y-coordinate and the radius of circle cic_i (109xi,yi109-10^9 \le x_i, y_i \le 10^9, 1ri1091 \le r_i \le 10^9).

Output

Print the integers a1,a2,,ana_1, a_2, \dots, a_n on the first line, separated by single spaces. aia_i is the index of the circle that eliminates cic_i.

Note

The picture in the statement shows the first example.