for v in sorted([[*input().split()]+[i+1] for i in range(int(input()))],key=lambda x:(x[0],-int(x[1]))):print(v[2]) [*input().split()]+[i+1] for i in range(int(input())) for i in range(int(input())) i range(int(input())) range int(input()) int input() input for i in range(int(input())) [*input().split()]+[i+1] [*input().split()] *input().split() input().split() ().split () input split [i+1] i+1 i 1 for v in sorted([[*input().split()]+[i+1] for i in range(int(input()))],key=lambda x:(x[0],-int(x[1]))):print(v[2]) v sorted([[*input().split()]+[i+1] for i in range(int(input()))],key=lambda x:(x[0],-int(x[1]))) sorted [[*input().split()]+[i+1] for i in range(int(input()))] 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 v in sorted([[*input().split()]+[i+1] for i in range(int(input()))],key=lambda x:(x[0],-int(x[1]))):print(v[2])