n=int(input())
l=[]
for i in range(n):
    temps,tempp=input().split()
    temp=[temps,int(tempp),i+1]
    l.append(temp)

l.sort(key=lambda x:x[1],reverse=True)
l.sort(key=lambda x:x[0])
for i in range(n):
    print(l[i][2]) n=int(input()) n int(input()) int input() input l=[] l [] for i in range(n):
    temps,tempp=input().split()
    temp=[temps,int(tempp),i+1]
    l.append(temp) i range(n) range n temps,tempp=input().split() temps input().split() ().split () input split tempp temp=[temps,int(tempp),i+1] temp [temps,int(tempp),i+1] temps int(tempp) int tempp i+1 i 1 l.append(temp) l.append l append temp l.sort(key=lambda x:x[1],reverse=True) l.sort l sort key=lambda x:x[1] key lambda x:x[1] x[1] x 1 x reverse=True reverse True l.sort(key=lambda x:x[0]) l.sort l sort key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x for i in range(n):
    print(l[i][2]) i range(n) range n print(l[i][2]) print l[i][2] [i] l i 2 temps,tempp=input().split() input().split() temps tempp=input().split() input().split() tempp temp=[temps,int(tempp),i+1] [temps,int(tempp),i+1] temp l=[] [] l n=int(input()) int(input()) n
n=int(input())
l=[]
for i in range(n):
    temps,tempp=input().split()
    temp=[temps,int(tempp),i+1]
    l.append(temp)

l.sort(key=lambda x:x[1],reverse=True)
l.sort(key=lambda x:x[0])
for i in range(n):
    print(l[i][2])
