N = int(input())
SPI = [input().split()+[i] for i in range(N)]
SPI.sort(key=lambda x:(x[0], -int(x[1])))
for _,_,i in SPI:
    print(i+1) N = int(input()) N int(input()) int input() input input().split()+[i] for i in range(N) for i in range(N) i range(N) range N for i in range(N) input().split()+[i] input().split() ().split () input split [i] i SPI = [input().split()+[i] for i in range(N)] SPI [input().split()+[i] for i in range(N)] SPI.sort(key=lambda x:(x[0], -int(x[1]))) SPI.sort SPI 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 _,_,i in SPI:
    print(i+1) _ _ i SPI print(i+1) print i+1 i 1 N = int(input()) int(input()) N SPI = [input().split()+[i] for i in range(N)] [input().split()+[i] for i in range(N)] SPI
N = int(input())
SPI = [input().split()+[i] for i in range(N)]
SPI.sort(key=lambda x:(x[0], -int(x[1])))
for _,_,i in SPI:
    print(i+1)