n=int(input())
R=[list(input().split()) + [i+1] for i in range(n)]
R.sort(key=lambda x: (x[0],-int(x[1])))
for r in R:
    print(r[2]) n=int(input()) n int(input()) int input() input list(input().split()) + [i+1] for i in range(n) for i in range(n) i range(n) range n for i in range(n) list(input().split()) + [i+1] list(input().split()) list input().split() ().split () input split [i+1] i+1 i 1 R=[list(input().split()) + [i+1] for i in range(n)] R [list(input().split()) + [i+1] for i in range(n)] R.sort(key=lambda x: (x[0],-int(x[1]))) R.sort R sort key=lambda x: (x[0],-int(x[1])) key lambda x: (x[0],-int(x[1])) (x[0],-int(x[1])) x[0] x 0 -int(x[1]) int(x[1]) int x[1] x 1 x for r in R:
    print(r[2]) r R print(r[2]) print r[2] r 2 R=[list(input().split()) + [i+1] for i in range(n)] [list(input().split()) + [i+1] for i in range(n)] R n=int(input()) int(input()) n
n=int(input())
R=[list(input().split()) + [i+1] for i in range(n)]
R.sort(key=lambda x: (x[0],-int(x[1])))
for r in R:
    print(r[2])