n = int(input())
s = list(list(input().split()) for _ in range(n))
ans = [s.index(i)+1 for i in sorted(s, key=lambda x:(x[0], -int(x[1])))]
for i in ans: print(i) n = int(input()) n int(input()) int input() input s = list(list(input().split()) for _ in range(n)) s list(list(input().split()) for _ in range(n)) list list(input().split()) list input().split() ().split () input split s.index(i)+1 for i in sorted(s, key=lambda x:(x[0], -int(x[1]))) for i in sorted(s, key=lambda x:(x[0], -int(x[1]))) i sorted(s, key=lambda x:(x[0], -int(x[1]))) sorted s 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 i in sorted(s, key=lambda x:(x[0], -int(x[1]))) s.index(i)+1 s.index(i) s.index s index i 1 ans = [s.index(i)+1 for i in sorted(s, key=lambda x:(x[0], -int(x[1])))] ans [s.index(i)+1 for i in sorted(s, key=lambda x:(x[0], -int(x[1])))] for i in ans: print(i) i ans s = list(list(input().split()) for _ in range(n)) list(list(input().split()) for _ in range(n)) s n = int(input()) int(input()) n ans = [s.index(i)+1 for i in sorted(s, key=lambda x:(x[0], -int(x[1])))] [s.index(i)+1 for i in sorted(s, key=lambda x:(x[0], -int(x[1])))] ans
n = int(input())
s = list(list(input().split()) for _ in range(n))
ans = [s.index(i)+1 for i in sorted(s, key=lambda x:(x[0], -int(x[1])))]
for i in ans: print(i)
