#!/usr/bin/env python3
n = int(input())
e = sorted([[str(i + 1)] + input().split() for i in range(n)],
           key=lambda x: int(x[2]),
           reverse=True)
d = dict()
for i in e:
    if i[1] not in d:
        d[i[1]] = []
    d[i[1]].append(i[0])
e = sorted(d.items(), key=lambda x: x[0])
for i in e:
    print(*i[1], sep="\n") n = int(input()) n int(input()) int input() input [str(i + 1)] + input().split() for i in range(n) for i in range(n) i range(n) range n for i in range(n) [str(i + 1)] + input().split() [str(i + 1)] str(i + 1) str i + 1 i 1 input().split() ().split () input split e = sorted([[str(i + 1)] + input().split() for i in range(n)],
           key=lambda x: int(x[2]),
           reverse=True) e sorted([[str(i + 1)] + input().split() for i in range(n)],
           key=lambda x: int(x[2]),
           reverse=True) sorted [[str(i + 1)] + input().split() for i in range(n)] key=lambda x: int(x[2]) key lambda x: int(x[2]) int(x[2]) int x[2] x 2 x reverse=True reverse True d = dict() d dict() dict for i in e:
    if i[1] not in d:
        d[i[1]] = []
    d[i[1]].append(i[0]) i e if i[1] not in d:
        d[i[1]] = []
     i[1] not in d i[1] i 1 d d[i[1]] = [] d[i[1]] d i[1] i 1 [] d[i[1]].append(i[0]) [i[1]].append [i[1]] d i[1] i 1 append i[0] i 0 e = sorted(d.items(), key=lambda x: x[0]) e sorted(d.items(), key=lambda x: x[0]) sorted d.items() d.items d items key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x for i in e:
    print(*i[1], sep="\n") i e print(*i[1], sep="\n") print *i[1] i[1] i 1 sep="\n" sep "\n" e = sorted([[str(i + 1)] + input().split() for i in range(n)],
           key=lambda x: int(x[2]),
           reverse=True) sorted([[str(i + 1)] + input().split() for i in range(n)],
           key=lambda x: int(x[2]),
           reverse=True) e d = dict() dict() d e = sorted(d.items(), key=lambda x: x[0]) sorted(d.items(), key=lambda x: x[0]) e n = int(input()) int(input()) n
#!/usr/bin/env python3
n = int(input())
e = sorted([[str(i + 1)] + input().split() for i in range(n)],
           key=lambda x: int(x[2]),
           reverse=True)
d = dict()
for i in e:
    if i[1] not in d:
        d[i[1]] = []
    d[i[1]].append(i[0])
e = sorted(d.items(), key=lambda x: x[0])
for i in e:
    print(*i[1], sep="\n")
