Solution)
 
d = dict()
n=int(input())
for _ in range(n):
  id, gas = map(int, input().split())
  d[id]=gas
 
res=sorted(d.items())
 
for i in range(n):
  print(res[i][0], res[i][1],end='\n')

+ Recent posts