N=int(input())
shop=[]
for i in range(N):
    S,P=input().split()
    P=int(P)
    shop.append([S,100-P,i])
shop.sort()
for i in range(N):
    print(shop[i][2]+1) N=int(input()) N int(input()) int input() input shop=[] shop [] for i in range(N):
    S,P=input().split()
    P=int(P)
    shop.append([S,100-P,i]) i range(N) range N S,P=input().split() S input().split() ().split () input split P P=int(P) P int(P) int P shop.append([S,100-P,i]) shop.append shop append [S,100-P,i] S 100-P 100 P i shop.sort() shop.sort shop sort for i in range(N):
    print(shop[i][2]+1) i range(N) range N print(shop[i][2]+1) print shop[i][2]+1 shop[i][2] [i] shop i 2 1 S,P=input().split() input().split() S shop=[] [] shop P=input().split() input().split() P N=int(input()) int(input()) N P=int(P) int(P) P
N=int(input())
shop=[]
for i in range(N):
    S,P=input().split()
    P=int(P)
    shop.append([S,100-P,i])
shop.sort()
for i in range(N):
    print(shop[i][2]+1)
