n=int(input())
sp=[list(input().split()) for _ in range(n)]
for i in sp:
    i[1]=100-int(i[1])
for i in range(n):
    sp[i].append(i+1)
sp.sort()
for i in sp:
    print(i[2]) n=int(input()) n int(input()) int input() input list(input().split()) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(input().split()) list input().split() ().split () input split sp=[list(input().split()) for _ in range(n)] sp [list(input().split()) for _ in range(n)] for i in sp:
    i[1]=100-int(i[1]) i sp i[1]=100-int(i[1]) i[1] i 1 100-int(i[1]) 100 int(i[1]) int i[1] i 1 for i in range(n):
    sp[i].append(i+1) i range(n) range n sp[i].append(i+1) [i].append [i] sp i append i+1 i 1 sp.sort() sp.sort sp sort for i in sp:
    print(i[2]) i sp print(i[2]) print i[2] i 2 n=int(input()) int(input()) n sp=[list(input().split()) for _ in range(n)] [list(input().split()) for _ in range(n)] sp
n=int(input())
sp=[list(input().split()) for _ in range(n)]
for i in sp:
    i[1]=100-int(i[1])
for i in range(n):
    sp[i].append(i+1)
sp.sort()
for i in sp:
    print(i[2])
