n = int(input())
m = []
for i in range(n):
m.append(int(input()))
m = sorted(m)
for i in range(len(m)):
print(m[i])
import sys
N = int(sys.stdin.readline())
arr = []
for i in range(N):
arr.append(int(sys.stdin.readline()))
for i in sorted(arr):
print(i)