extendで連結
N,M = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
A.extend(B)
for i in A:
print(i)
でも+でできるらしい。。。
N,M = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
Ans = A + B
for i in A:
print(i)