νμμ λμ΄κ° μ¦κ°νλ μμΌλ‘, λμ΄κ° κ°λ€λ©΄ λ¨Όμ κ°μ ν μμλλ‘ μ λ ¬
1. νμμ λμ΄μ μ΄λ¦μ member 리μ€νΈ μμ 리μ€νΈ ννλ‘ μ λ ₯λ°λλ€
2. κ°μ ν μμλλ‘ μ λ ₯λ°κΈ° λλ¬Έμ λμ΄ μμΌλ‘λ§ μ λ ¬νλ€
=> λ΄μ₯ν¨μ sorted() μ¬μ©
# 10814.py
import sys
n = int(sys.stdin.readline())
member = [list(sys.stdin.readline().split()) for _ in range(n)]
member = sorted(member, key=lambda t: int(t[0]))
for i in member:
print(i[0], i[1])