N = int(input())
A = [list(input().split()) for _ in range(N)]
A = [(A[i][0],int(A[i][1]),i+1) for i in range(N)]
A = sorted(A,key=lambda x:x[1],reverse=True)
A = sorted(A,key=lambda x:x[0])
for i in range(N):
    print(A[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 A = [list(input().split()) for _ in range(N)] A [list(input().split()) for _ in range(N)] (A[i][0],int(A[i][1]),i+1) for i in range(N) for i in range(N) i range(N) range N for i in range(N) (A[i][0],int(A[i][1]),i+1) A[i][0] [i] A i 0 int(A[i][1]) int A[i][1] [i] A i 1 i+1 i 1 A = [(A[i][0],int(A[i][1]),i+1) for i in range(N)] A [(A[i][0],int(A[i][1]),i+1) for i in range(N)] A = sorted(A,key=lambda x:x[1],reverse=True) A sorted(A,key=lambda x:x[1],reverse=True) sorted A key=lambda x:x[1] key lambda x:x[1] x[1] x 1 x reverse=True reverse True A = sorted(A,key=lambda x:x[0]) A sorted(A,key=lambda x:x[0]) sorted A key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x for i in range(N):
    print(A[i][2]) i range(N) range N print(A[i][2]) print A[i][2] [i] A i 2 A = sorted(A,key=lambda x:x[0]) sorted(A,key=lambda x:x[0]) A N = int(input()) int(input()) N A = [(A[i][0],int(A[i][1]),i+1) for i in range(N)] [(A[i][0],int(A[i][1]),i+1) for i in range(N)] A A = sorted(A,key=lambda x:x[1],reverse=True) sorted(A,key=lambda x:x[1],reverse=True) A A = [list(input().split()) for _ in range(N)] [list(input().split()) for _ in range(N)] A
N = int(input())
A = [list(input().split()) for _ in range(N)]
A = [(A[i][0],int(A[i][1]),i+1) for i in range(N)]
A = sorted(A,key=lambda x:x[1],reverse=True)
A = sorted(A,key=lambda x:x[0])
for i in range(N):
    print(A[i][2])