N = int(input())
A = []
for i in range(N):
    S, P = input().split()
    A.append((S,-int(P), i))
A.sort()
print(*list(i+1 for _, _, i in A)) N = int(input()) N int(input()) int input() input A = [] A [] for i in range(N):
    S, P = input().split()
    A.append((S,-int(P), i)) i range(N) range N S, P = input().split() S input().split() ().split () input split P A.append((S,-int(P), i)) A.append A append (S,-int(P), i) S -int(P) int(P) int P i A.sort() A.sort A sort print(*list(i+1 for _, _, i in A)) print *list(i+1 for _, _, i in A) list(i+1 for _, _, i in A) list i+1 i 1 N = int(input()) int(input()) N S, P = input().split() input().split() S P = input().split() input().split() P A = [] [] A
N = int(input())
A = []
for i in range(N):
    S, P = input().split()
    A.append((S,-int(P), i))
A.sort()
print(*list(i+1 for _, _, i in A))