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