n=int(input())
A = [list(map(str,input().split())) for i in range(n)]
A_s = sorted(A, key=lambda x: int(x[1]), reverse=True)
A_ss = sorted(A_s, key=lambda x: x[0], reverse=False)
for i in range(n):
    print(A.index( A_ss[i])+1) n=int(input()) n int(input()) int input() input list(map(str,input().split())) for i in range(n) for i in range(n) i range(n) range n for i in range(n) list(map(str,input().split())) list map(str,input().split()) map str input().split() ().split () input split A = [list(map(str,input().split())) for i in range(n)] A [list(map(str,input().split())) for i in range(n)] A_s = sorted(A, key=lambda x: int(x[1]), reverse=True) A_s sorted(A, key=lambda x: int(x[1]), reverse=True) sorted A key=lambda x: int(x[1]) key lambda x: int(x[1]) int(x[1]) int x[1] x 1 x reverse=True reverse True A_ss = sorted(A_s, key=lambda x: x[0], reverse=False) A_ss sorted(A_s, key=lambda x: x[0], reverse=False) sorted A_s key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x reverse=False reverse False for i in range(n):
    print(A.index( A_ss[i])+1) i range(n) range n print(A.index( A_ss[i])+1) print A.index( A_ss[i])+1 A.index( A_ss[i]) A.index A index A_ss[i] A_ss i 1 n=int(input()) int(input()) n A = [list(map(str,input().split())) for i in range(n)] [list(map(str,input().split())) for i in range(n)] A A_s = sorted(A, key=lambda x: int(x[1]), reverse=True) sorted(A, key=lambda x: int(x[1]), reverse=True) A_s A_ss = sorted(A_s, key=lambda x: x[0], reverse=False) sorted(A_s, key=lambda x: x[0], reverse=False) A_ss
n=int(input())
A = [list(map(str,input().split())) for i in range(n)]
A_s = sorted(A, key=lambda x: int(x[1]), reverse=True)
A_ss = sorted(A_s, key=lambda x: x[0], reverse=False)
for i in range(n):
    print(A.index( A_ss[i])+1)