Incinerate el
The galaxy is mired in heresy. Especially it concerns planet Lataros, segmentum Obscurus. Here everything is desecrated and everything should be cleaned. This time, the cleansing flame to the enemies of the Immortal God-Emperor is the latest development of the Adeptus Mechanicus - the tank "Ispepelit el". The Adepta Sororitas reconnaissance squadrons have already discovered all n bases of godly xenos, traitor heretics and insidious mutants. The tank will be dropped into one of the bases, and then must, moving by its own pace, visit all the bases once. Since excessive inert tortuosity is alien to the sons of the Imperium, the tank must go from base to base in a straight line. Of course, having reached the base, the tank will immediately incinerate all the enemies of the Imperium (and el).
Brothers and sisters, your task is to develop a route for the tank. The task is complicated by the fact that the tank leaves behind a deep trench full of glowing napalm, so the route should not be self-intersecting.
Input
The first line contains the number of bases n (1 ≤ n ≤ 10^3
). Next n lines contains the base coordinates – the integers not greater than 2 * 10^9
.
Output
Print n integers - the base numbers in the order of their traversal by the tank.