N=int(input())
data=[input().split() for i in range(N)]
data_name=[]
for i in range(N):
    if data[i][0] in data_name:
        continue
    else:
        data_name.append(data[i][0])
data_name_sort=sorted(data_name)
#print(data_name_sort)
data_point=[]
for i in range(N):
    num=0
    for j in range(len(data_name_sort)):
        if data[i][0]==data_name_sort[j]:
            num+=(len(data_name)-j)*200+int(data[i][1])
        else:
            continue
    data_point.append(num)
#print(data_point)
data_sort=[i for i, _ in sorted(enumerate(data_point), key=lambda x:x[1])][::-1]
#print(data_sort)
for i in range(N):
    ans=int(data_sort[i])+1
    print(ans) 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 data=[input().split() for i in range(N)] data [input().split() for i in range(N)] data_name=[] data_name [] for i in range(N):
    if data[i][0] in data_name:
        continue
    else:
        data_name.append(data[i][0]) i range(N) range N if data[i][0] in data_name:
        continue
    else:
        data_name.append(data[i][0]) data[i][0] in data_name data[i][0] [i] data i 0 data_name continue data_name.append(data[i][0]) data_name.append data_name append data[i][0] [i] data i 0 data_name_sort=sorted(data_name) data_name_sort sorted(data_name) sorted data_name data_point=[] data_point [] for i in range(N):
    num=0
    for j in range(len(data_name_sort)):
        if data[i][0]==data_name_sort[j]:
            num+=(len(data_name)-j)*200+int(data[i][1])
        else:
            continue
    data_point.append(num)
#print(data_point) i range(N) range N num=0 num 0 for j in range(len(data_name_sort)):
        if data[i][0]==data_name_sort[j]:
            num+=(len(data_name)-j)*200+int(data[i][1])
        else:
            continue
     j range(len(data_name_sort)) range len(data_name_sort) len data_name_sort if data[i][0]==data_name_sort[j]:
            num+=(len(data_name)-j)*200+int(data[i][1])
        else:
            continue
     data[i][0]==data_name_sort[j] data[i][0] [i] data i 0 data_name_sort[j] data_name_sort j num+=(len(data_name)-j)*200+int(data[i][1]) num (len(data_name)-j)*200+int(data[i][1]) (len(data_name)-j)*200 len(data_name)-j len(data_name) len data_name j 200 int(data[i][1]) int data[i][1] [i] data i 1 continue data_point.append(num) data_point.append data_point append num i for i, _ in sorted(enumerate(data_point), key=lambda x:x[1]) for i, _ in sorted(enumerate(data_point), key=lambda x:x[1]) i _ sorted(enumerate(data_point), key=lambda x:x[1]) sorted enumerate(data_point) enumerate data_point key=lambda x:x[1] key lambda x:x[1] x[1] x 1 x for i, _ in sorted(enumerate(data_point), key=lambda x:x[1]) i data_sort=[i for i, _ in sorted(enumerate(data_point), key=lambda x:x[1])][::-1] data_sort [i for i, _ in sorted(enumerate(data_point), key=lambda x:x[1])][::-1] [i for i, _ in sorted(enumerate(data_point), key=lambda x:x[1])] ::-1 -1 for i in range(N):
    ans=int(data_sort[i])+1
    print(ans) i range(N) range N ans=int(data_sort[i])+1 ans int(data_sort[i])+1 int(data_sort[i]) int data_sort[i] data_sort i 1 print(ans) print ans data_name_sort=sorted(data_name) sorted(data_name) data_name_sort data_sort=[i for i, _ in sorted(enumerate(data_point), key=lambda x:x[1])][::-1] [i for i, _ in sorted(enumerate(data_point), key=lambda x:x[1])][::-1] data_sort N=int(input()) int(input()) N num+=(len(data_name)-j)*200+int(data[i][1]) (len(data_name)-j)*200+int(data[i][1]) num data=[input().split() for i in range(N)] [input().split() for i in range(N)] data num=0 0 num data_point=[] [] data_point ans=int(data_sort[i])+1 int(data_sort[i])+1 ans data_name=[] [] data_name
N=int(input())
data=[input().split() for i in range(N)]
data_name=[]
for i in range(N):
    if data[i][0] in data_name:
        continue
    else:
        data_name.append(data[i][0])
data_name_sort=sorted(data_name)
#print(data_name_sort)
data_point=[]
for i in range(N):
    num=0
    for j in range(len(data_name_sort)):
        if data[i][0]==data_name_sort[j]:
            num+=(len(data_name)-j)*200+int(data[i][1])
        else:
            continue
    data_point.append(num)
#print(data_point)
data_sort=[i for i, _ in sorted(enumerate(data_point), key=lambda x:x[1])][::-1]
#print(data_sort)
for i in range(N):
    ans=int(data_sort[i])+1
    print(ans)