fork download
  1. k,l = map(int,input().split())
  2. o = {int(x) for x in input().split()}
  3. p = {int(y) for y in input().split()}
  4. x = sorted(list(o.union(p)))
  5. for z in x:
  6. print(z, end=" ")
Success #stdin #stdout 0.02s 9296KB
stdin
5 5
1 3 5 7 8
2 3 4 7 9
stdout
1 2 3 4 5 7 8 9