n= int(input())
x = [input().split() for i in range(n)]
for i in range(n):
    x[i].append(i+1)
y= sorted(x,key= lambda i:(i[0],-int(i[1])))
for i in range(n):
    print(y[i][2]) n= int(input()) n int(input()) int input() input input().split() for i in range(n) for i in range(n) i range(n) range n for i in range(n) input().split() ().split () input split x = [input().split() for i in range(n)] x [input().split() for i in range(n)] for i in range(n):
    x[i].append(i+1) i range(n) range n x[i].append(i+1) [i].append [i] x i append i+1 i 1 y= sorted(x,key= lambda i:(i[0],-int(i[1]))) y sorted(x,key= lambda i:(i[0],-int(i[1]))) sorted x key= lambda i:(i[0],-int(i[1])) key lambda i:(i[0],-int(i[1])) (i[0],-int(i[1])) i[0] i 0 -int(i[1]) int(i[1]) int i[1] i 1 i for i in range(n):
    print(y[i][2]) i range(n) range n print(y[i][2]) print y[i][2] [i] y i 2 n= int(input()) int(input()) n y= sorted(x,key= lambda i:(i[0],-int(i[1]))) sorted(x,key= lambda i:(i[0],-int(i[1]))) y x = [input().split() for i in range(n)] [input().split() for i in range(n)] x
n= int(input())
x = [input().split() for i in range(n)]
for i in range(n):
    x[i].append(i+1)
y= sorted(x,key= lambda i:(i[0],-int(i[1])))
for i in range(n):
    print(y[i][2])