H,W=list(map(int,input().split()))

cw=[eval(input()) for _ in range(H)]

cw2=cw

for i,j in zip(cw,cw2):

  print(i)

  print(j)
H,W=map(int,input().split())

cw=[input() for _ in range(H)]

[print(i + '\n' + j) for i,j in zip(cw,cw)]

H, W = list(map(int, input().split()))
cw = [eval(input()) for _ in range(H)]
cw2 = cw
for i, j in zip(cw, cw2):
    print(i)
    print(j)

H, W = map(int, input().split())
cw = [input() for _ in range(H)]
[print(i + "\n" + j) for i, j in zip(cw, cw)]

-H, W = list(map(int, input().split())) -cw = [eval(input()) for _ in range(H)] -cw2 = cw -for i, j in zip(cw, cw2): -    print(i) -    print(j) +H, W = map(int, input().split()) +cw = [input() for _ in range(H)] +[print(i + "\n" + j) for i, j in zip(cw, cw)]