N = int(input())
lis = [list(input().split()) for i in range(N)]

new_lis = sorted(lis, key=lambda x: (x[0], -int(x[1])))

for i in new_lis:
    print(lis.index(i) + 1) N = int(input()) N int(input()) int input() input list(input().split()) for i in range(N) for i in range(N) i range(N) range N for i in range(N) list(input().split()) list input().split() ().split () input split lis = [list(input().split()) for i in range(N)] lis [list(input().split()) for i in range(N)] new_lis = sorted(lis, key=lambda x: (x[0], -int(x[1]))) new_lis sorted(lis, key=lambda x: (x[0], -int(x[1]))) sorted lis key=lambda x: (x[0], -int(x[1])) key lambda x: (x[0], -int(x[1])) (x[0], -int(x[1])) x[0] x 0 -int(x[1]) int(x[1]) int x[1] x 1 x for i in new_lis:
    print(lis.index(i) + 1) i new_lis print(lis.index(i) + 1) print lis.index(i) + 1 lis.index(i) lis.index lis index i 1 lis = [list(input().split()) for i in range(N)] [list(input().split()) for i in range(N)] lis new_lis = sorted(lis, key=lambda x: (x[0], -int(x[1]))) sorted(lis, key=lambda x: (x[0], -int(x[1]))) new_lis N = int(input()) int(input()) N
N = int(input())
lis = [list(input().split()) for i in range(N)]

new_lis = sorted(lis, key=lambda x: (x[0], -int(x[1])))

for i in new_lis:
    print(lis.index(i) + 1)