N = int(input())
lis = [(input() + " " + str(i+1)).split() for i in range(N)]

lis = [k for k in lis]

lis.sort(key=lambda k: int(k[1]), reverse=True)
lis.sort(key=lambda k: k[0])


for j in lis:
    print(j[2]) N = int(input()) N int(input()) int input() input (input() + " " + str(i+1)).split() for i in range(N) for i in range(N) i range(N) range N for i in range(N) (input() + " " + str(i+1)).split() input() + " " + str(i+1)).split input() + " " + str(i+1) input() + " " input() input " " str(i+1) str i+1 i 1 split lis = [(input() + " " + str(i+1)).split() for i in range(N)] lis [(input() + " " + str(i+1)).split() for i in range(N)] k for k in lis for k in lis k lis for k in lis k lis = [k for k in lis] lis [k for k in lis] lis.sort(key=lambda k: int(k[1]), reverse=True) lis.sort lis sort key=lambda k: int(k[1]) key lambda k: int(k[1]) int(k[1]) int k[1] k 1 k reverse=True reverse True lis.sort(key=lambda k: k[0]) lis.sort lis sort key=lambda k: k[0] key lambda k: k[0] k[0] k 0 k for j in lis:
    print(j[2]) j lis print(j[2]) print j[2] j 2 N = int(input()) int(input()) N lis = [(input() + " " + str(i+1)).split() for i in range(N)] [(input() + " " + str(i+1)).split() for i in range(N)] lis lis = [k for k in lis] [k for k in lis] lis
N = int(input())
lis = [(input() + " " + str(i+1)).split() for i in range(N)]

lis = [k for k in lis]

lis.sort(key=lambda k: int(k[1]), reverse=True)
lis.sort(key=lambda k: k[0])


for j in lis:
    print(j[2])
