N = int(input())

G = []

for i in range(N):
    s,p = input().split()
    g = [s] + [100 - int(p)] + [i + 1]
    G.append(g)

G = sorted(G)

for i in range(N):
    print(G[i][2]) N = int(input()) N int(input()) int input() input G = [] G [] for i in range(N):
    s,p = input().split()
    g = [s] + [100 - int(p)] + [i + 1]
    G.append(g) i range(N) range N s,p = input().split() s input().split() ().split () input split p g = [s] + [100 - int(p)] + [i + 1] g [s] + [100 - int(p)] + [i + 1] [s] + [100 - int(p)] [s] s [100 - int(p)] 100 - int(p) 100 int(p) int p [i + 1] i + 1 i 1 G.append(g) G.append G append g G = sorted(G) G sorted(G) sorted G for i in range(N):
    print(G[i][2]) i range(N) range N print(G[i][2]) print G[i][2] [i] G i 2 g = [s] + [100 - int(p)] + [i + 1] [s] + [100 - int(p)] + [i + 1] g G = sorted(G) sorted(G) G p = input().split() input().split() p G = [] [] G s,p = input().split() input().split() s N = int(input()) int(input()) N
N = int(input())

G = []

for i in range(N):
    s,p = input().split()
    g = [s] + [100 - int(p)] + [i + 1]
    G.append(g)

G = sorted(G)

for i in range(N):
    print(G[i][2])