N = int(input())

L = []

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

L = []

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