n=int(input())
l=[input().split() for i in range(n)]
l2=[x for x in range(n)]
base=list(zip(l2,l))
ans=sorted(base, key=lambda x: int(x[1][1]),reverse=True)
ans=sorted(ans,key=lambda x: x[1][0])

for i in range(n):
    print(1+ans[i][0]) n=int(input()) n int(input()) int input() input input().split() for i in range(n) for i in range(n) i range(n) range n for i in range(n) input().split() ().split () input split l=[input().split() for i in range(n)] l [input().split() for i in range(n)] x for x in range(n) for x in range(n) x range(n) range n for x in range(n) x l2=[x for x in range(n)] l2 [x for x in range(n)] base=list(zip(l2,l)) base list(zip(l2,l)) list zip(l2,l) zip l2 l ans=sorted(base, key=lambda x: int(x[1][1]),reverse=True) ans sorted(base, key=lambda x: int(x[1][1]),reverse=True) sorted base key=lambda x: int(x[1][1]) key lambda x: int(x[1][1]) int(x[1][1]) int x[1][1] [1] x 1 1 x reverse=True reverse True ans=sorted(ans,key=lambda x: x[1][0]) ans sorted(ans,key=lambda x: x[1][0]) sorted ans key=lambda x: x[1][0] key lambda x: x[1][0] x[1][0] [1] x 1 0 x for i in range(n):
    print(1+ans[i][0]) i range(n) range n print(1+ans[i][0]) print 1+ans[i][0] 1 ans[i][0] [i] ans i 0 base=list(zip(l2,l)) list(zip(l2,l)) base n=int(input()) int(input()) n ans=sorted(ans,key=lambda x: x[1][0]) sorted(ans,key=lambda x: x[1][0]) ans l=[input().split() for i in range(n)] [input().split() for i in range(n)] l l2=[x for x in range(n)] [x for x in range(n)] l2 ans=sorted(base, key=lambda x: int(x[1][1]),reverse=True) sorted(base, key=lambda x: int(x[1][1]),reverse=True) ans
n=int(input())
l=[input().split() for i in range(n)]
l2=[x for x in range(n)]
base=list(zip(l2,l))
ans=sorted(base, key=lambda x: int(x[1][1]),reverse=True)
ans=sorted(ans,key=lambda x: x[1][0])

for i in range(n):
    print(1+ans[i][0])