생성일: 2022년 1월 11일 오후 4:58
# 두 리스트 합치기
import sys
sys.stdin = open("input.txt", "rt")
n = int(input())
firstList = list(map(int, input().split()))
m = int(input())
secondList = list(map(int, input().split()))
result = firstList + secondList
result.sort()
for x in result:
print(x, end=" ")
import sys
sys.stdin=open("input.txt", "r")
n=int(input())
a=list(map(int, input().split()))
m=int(input())
b=list(map(int, input().split()))
p1=p2=0
c=[]
while p1<n and p2<m:
if a[p1]<b[p2]:
c.append(a[p1])
p1+=1
else:
c.append(b[p2])
p2+=1
if p1<n:
c=c+a[p1:]
if p2<m:
c=c+b[p2:]
for x in c:
print(x, end=' ')