On a plane are *n* points (*x*<sub class="lower-index">*i*</sub>, *y*<sub class="lower-index">*i*</sub>) with integer coordinates between 0 and 10<sup class="upper-index">6</sup>. The distance between the two points with numbers *a* and *b* is said to be the following value: <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/03274f8c977ad3feb5d9f6ede91c69bcaef04972.png" style="max-width: 100.0%;max-height: 100.0%;"/> (the distance calculated by such formula is called Manhattan distance).

We call a hamiltonian path to be some permutation *p*<sub class="lower-index">*i*</sub> of numbers from 1 to *n*. We say that the length of this path is value <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/2872e932e7cab8f5f7a9c718441f7534261ed638.png" style="max-width: 100.0%;max-height: 100.0%;"/>.

Find some hamiltonian path with a length of no more than 25 × 10<sup class="upper-index">8</sup>. Note that you do not have to minimize the path length.
The first line contains integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">6</sup>).

The *i* + 1-th line contains the coordinates of the *i*-th point: *x*<sub class="lower-index">*i*</sub> and *y*<sub class="lower-index">*i*</sub> (0 ≤ *x*<sub class="lower-index">*i*</sub>, *y*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">6</sup>).

It is guaranteed that no two points coincide.
# -*- coding: utf-8 -*-
# @Author: Ang Jian Hwee
# @Date:   2022-11-15 19:41:13
# @Last Modified by:   Ang Jian Hwee
# @Last Modified time: 2022-11-15 19:52:21

arr = []
for i in range(int(input())):
    arr.append([int(x) for x in input().strip().split() if x != ""])

dist = [[0 for __ in range(len(arr))] for _ in range(len(arr))]

for i in range(len(arr)):
	for j in range(len(arr)):
		x = abs(arr[i][0] - arr[j][0]) + abs(arr[i][1] - arr[j][1])
		dist[i][j] = x
		dist[j][i] = x

def greedy(d,s,v = [],c = 0):
	if len(v) == len(d):
		return v, c
	else:
		mi = None
		for j in range(len(d[s])):
			if j in v:
				continue
			else:
				if mi is None:
					mi = j
				else:
					if d[s][mi] > d[s][j]:
						mi = j
				v.append(mi)
				return greedy(d,mi,v, c + d[s][mi])
# print(arr, dist)
for i in range(len(dist)):
	a,b = greedy(dist, 0)
	if b <= 25*(10**8):
		print(" ".join([str(a_) for a_ in a]))
		break
   	 				 	  	 	 			  	 	  	