n = int(input())
l = [{} for d in range(n)]
for i in range(n):
  s,p = input().split()
  l[i] = {'City': s, 'Point': int(p), 'Number': i+1}
l.sort(key=lambda x: (x['City'],-x['Point']))
for num in l:
  print(num['Number']) n = int(input()) n int(input()) int input() input {} for d in range(n) for d in range(n) d range(n) range n for d in range(n) {} l = [{} for d in range(n)] l [{} for d in range(n)] for i in range(n):
  s,p = input().split()
  l[i] = {'City': s, 'Point': int(p), 'Number': i+1} i range(n) range n s,p = input().split() s input().split() ().split () input split p l[i] = {'City': s, 'Point': int(p), 'Number': i+1} l[i] l i {'City': s, 'Point': int(p), 'Number': i+1} 'City' 'City' s 'Point' 'Point' int(p) int p 'Number' 'Number' i+1 i 1 l.sort(key=lambda x: (x['City'],-x['Point'])) l.sort l sort key=lambda x: (x['City'],-x['Point']) key lambda x: (x['City'],-x['Point']) (x['City'],-x['Point']) x['City'] x 'City' -x['Point'] x['Point'] x 'Point' x for num in l:
  print(num['Number']) num l print(num['Number']) print num['Number'] num 'Number' l = [{} for d in range(n)] [{} for d in range(n)] l n = int(input()) int(input()) n s,p = input().split() input().split() s p = input().split() input().split() p
n = int(input())
l = [{} for d in range(n)]
for i in range(n):
  s,p = input().split()
  l[i] = {'City': s, 'Point': int(p), 'Number': i+1}
l.sort(key=lambda x: (x['City'],-x['Point']))
for num in l:
  print(num['Number'])