fork(1) download
  1. n = int(input())
  2. LIST=[]
  3. for i in range(n):
  4. LIST.append(input().split())
  5.  
  6. LIST.sort(key = lambda x:x[0])
  7. for i in LIST:
  8. print(*i)
Success #stdin #stdout 0.02s 9336KB
stdin
2
9 a
10 b
stdout
10 b
9 a