N = int(input())
S = [list(input().split()) for _ in range(N)]
for i in S:
    i[1] = 100 - int(i[1])
for i in range(N):
    S[i] += i+1,
S.sort()
for i in S:
    print(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 S = [list(input().split()) for _ in range(N)] S [list(input().split()) for _ in range(N)] for i in S:
    i[1] = 100 - int(i[1]) i S i[1] = 100 - int(i[1]) i[1] i 1 100 - int(i[1]) 100 int(i[1]) int i[1] i 1 for i in range(N):
    S[i] += i+1, i range(N) range N S[i] += i+1, S[i] S i i+1 i 1 S.sort() S.sort S sort for i in S:
    print(i[2]) i S print(i[2]) print i[2] i 2 N = int(input()) int(input()) N S = [list(input().split()) for _ in range(N)] [list(input().split()) for _ in range(N)] S
N = int(input())
S = [list(input().split()) for _ in range(N)]
for i in S:
    i[1] = 100 - int(i[1])
for i in range(N):
    S[i] += i+1,
S.sort()
for i in S:
    print(i[2])