n = int(input())

s = []

for i in range(n):
	s.append((input()+' '+str(i)).split())

for i in range(n):
	s[i][1] = int(s[i][1])
    
s.sort(key=lambda x:x[1], reverse=True)
s.sort(key=lambda x:x[0])

for i in s:
	print(int(i[2])+1) n = int(input()) n int(input()) int input() input s = [] s [] for i in range(n):
	s.append((input()+' '+str(i)).split()) i range(n) range n s.append((input()+' '+str(i)).split()) s.append s append (input()+' '+str(i)).split() input()+' '+str(i)).split input()+' '+str(i) input()+' ' input() input ' ' str(i) str i split for i in range(n):
	s[i][1] = int(s[i][1])
     i range(n) range n s[i][1] = int(s[i][1]) s[i][1] [i] s i 1 int(s[i][1]) int s[i][1] [i] s i 1 s.sort(key=lambda x:x[1], reverse=True) s.sort s sort key=lambda x:x[1] key lambda x:x[1] x[1] x 1 x reverse=True reverse True s.sort(key=lambda x:x[0]) s.sort s sort key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x for i in s:
	print(int(i[2])+1) i s print(int(i[2])+1) print int(i[2])+1 int(i[2]) int i[2] i 2 1 s = [] [] s n = int(input()) int(input()) n
n = int(input())

s = []

for i in range(n):
	s.append((input()+' '+str(i)).split())

for i in range(n):
	s[i][1] = int(s[i][1])
    
s.sort(key=lambda x:x[1], reverse=True)
s.sort(key=lambda x:x[0])

for i in s:
	print(int(i[2])+1)