N, *A = open(0).read().split()
A = sorted((s, -int(p), i) for i, (s, p) in enumerate(zip(*[iter(A)]*2)))
print('\n'.join(map(str, (x[2]+1 for x in A)))) N, *A = open(0).read().split() N open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split *A A A = sorted((s, -int(p), i) for i, (s, p) in enumerate(zip(*[iter(A)]*2))) A sorted((s, -int(p), i) for i, (s, p) in enumerate(zip(*[iter(A)]*2))) sorted (s, -int(p), i) s -int(p) int(p) int p i x[2]+1 for x in A for x in A x A for x in A x[2]+1 x[2] x 2 1 print('\n'.join(map(str, (x[2]+1 for x in A)))) print '\n'.join(map(str, (x[2]+1 for x in A))) '\n'.join '\n' join map(str, (x[2]+1 for x in A)) map str (x[2]+1 for x in A) N, *A = open(0).read().split() open(0).read().split() N A = sorted((s, -int(p), i) for i, (s, p) in enumerate(zip(*[iter(A)]*2))) sorted((s, -int(p), i) for i, (s, p) in enumerate(zip(*[iter(A)]*2))) A
N, *A = open(0).read().split()
A = sorted((s, -int(p), i) for i, (s, p) in enumerate(zip(*[iter(A)]*2)))
print('\n'.join(map(str, (x[2]+1 for x in A))))
