n = int(input())
l = [input().split() for i in range(1,n+1)]

for i in range(1,n+1):
    l[i-1].append(i)
#print(l)

for i in range(n):
    l[i][1] = (int(l[i][1]))*(-1)
#print(sorted(l))
sl = sorted(l)

#ans = sorted(l.sort(),reverse = True, key = lambda x:x[1])
#print(ans)

for i in range(n):
    print(sl[i][2]) n = int(input()) n int(input()) int input() input input().split() for i in range(1,n+1) for i in range(1,n+1) i range(1,n+1) range 1 n+1 n 1 for i in range(1,n+1) input().split() ().split () input split l = [input().split() for i in range(1,n+1)] l [input().split() for i in range(1,n+1)] for i in range(1,n+1):
    l[i-1].append(i)
#print(l) i range(1,n+1) range 1 n+1 n 1 l[i-1].append(i) [i-1].append [i-1] l i-1 i 1 append i for i in range(n):
    l[i][1] = (int(l[i][1]))*(-1)
#print(sorted(l)) i range(n) range n l[i][1] = (int(l[i][1]))*(-1) l[i][1] [i] l i 1 (int(l[i][1]))*(-1) int(l[i][1]) int l[i][1] [i] l i 1 -1 sl = sorted(l) sl sorted(l) sorted l for i in range(n):
    print(sl[i][2]) i range(n) range n print(sl[i][2]) print sl[i][2] [i] sl i 2 sl = sorted(l) sorted(l) sl l = [input().split() for i in range(1,n+1)] [input().split() for i in range(1,n+1)] l n = int(input()) int(input()) n
n = int(input())
l = [input().split() for i in range(1,n+1)]

for i in range(1,n+1):
    l[i-1].append(i)
#print(l)

for i in range(n):
    l[i][1] = (int(l[i][1]))*(-1)
#print(sorted(l))
sl = sorted(l)

#ans = sorted(l.sort(),reverse = True, key = lambda x:x[1])
#print(ans)

for i in range(n):
    print(sl[i][2])