N = int(input())
X = [[input().split(), i + 1] for i in range(N)]

X = sorted(X , key = lambda x:(x[0][0], -int(x[0][1])))

for i in range(N):
  print(X[i][1]) N = int(input()) N int(input()) int input() input [input().split(), i + 1] for i in range(N) for i in range(N) i range(N) range N for i in range(N) [input().split(), i + 1] input().split() ().split () input split i + 1 i 1 X = [[input().split(), i + 1] for i in range(N)] X [[input().split(), i + 1] for i in range(N)] X = sorted(X , key = lambda x:(x[0][0], -int(x[0][1]))) X sorted(X , key = lambda x:(x[0][0], -int(x[0][1]))) sorted X key = lambda x:(x[0][0], -int(x[0][1])) key lambda x:(x[0][0], -int(x[0][1])) (x[0][0], -int(x[0][1])) x[0][0] [0] x 0 0 -int(x[0][1]) int(x[0][1]) int x[0][1] [0] x 0 1 x for i in range(N):
  print(X[i][1]) i range(N) range N print(X[i][1]) print X[i][1] [i] X i 1 X = [[input().split(), i + 1] for i in range(N)] [[input().split(), i + 1] for i in range(N)] X X = sorted(X , key = lambda x:(x[0][0], -int(x[0][1]))) sorted(X , key = lambda x:(x[0][0], -int(x[0][1]))) X N = int(input()) int(input()) N
N = int(input())
X = [[input().split(), i + 1] for i in range(N)]

X = sorted(X , key = lambda x:(x[0][0], -int(x[0][1])))

for i in range(N):
  print(X[i][1])