p.180
import sys
input=sys.stdin.readline
N=int(input())
info=[]
for i in range(N):
info_data=input().split()
info.append((info_data[0],int(info_data[1])))
info.sort(key=lambda x:x[1])
for i in range(N):
print(info[i][0], end=' ')
p.180
import sys
input=sys.stdin.readline
N=int(input())
info=[]
for i in range(N):
info_data=input().split()
info.append((info_data[0],int(info_data[1])))
info.sort(key=lambda x:x[1])
for i in range(N):
print(info[i][0], end=' ')
댓글