Problem:
 Score : 200 points    Problem Statement There is an image with a height of H pixels and a width of W pixels. Each of the pixels is represented by either . or * . The character representing the pixel at the i -th row from the top and the j -th column from the left, is denoted by C_{i,j} .  Extend this image vertically so that its height is doubled. That is, print a image with a height of 2H pixels and a width of W pixels where the pixel at the i -th row and j -th column is equal to C_{(i+1)/2,j} (the result of division is rounded down).      Constraints  1≦H, W≦100  C_{i,j} is either . or * .         Input The input is given from Standard Input in the following format:  H  W  C_{1,1}...C_{1,W} : C_{H,1}...C_{H,W}       Output Print the extended image.        Sample Input 1 2 2
*.
.*      Sample Output 1 *.
*.
.*
.*       Sample Input 2 1 4
***.      Sample Output 2 ***.
***.       Sample Input 3 9 20
.....***....***.....
....*...*..*...*....
...*.....**.....*...
...*.....*......*...
....*.....*....*....
.....**..*...**.....
.......*..*.*.......
........**.*........
.........**.........      Sample Output 3 .....***....***.....
.....***....***.....
....*...*..*...*....
....*...*..*...*....
...*.....**.....*...
...*.....**.....*...
...*.....*......*...
...*.....*......*...
....*.....*....*....
....*.....*....*....
.....**..*...**.....
.....**..*...**.....
.......*..*.*.......
.......*..*.*.......
........**.*........
........**.*........
.........**.........
.........**.........

Solution (Python):
def solve():
    H,W = map(int, input().split())
    ret = ''
    for _ in range(H):
        input_line = input()
        ret += input_line+'\n'
        ret += input_line+'\n'
        
    print(ret[:-1])
    
solve()

Solution (Python):
h, w = map(int, input().split())

for _ in range(h):
    s = input()
    print(s)
    print(s)

Solution (Python):
h, w = map(int,input().split())
for i in range(h):
    print((input() + "\n")* 2)

Solution (Python):
H, W = map(int, input().split())
C = [input() for _ in range(H)]
A = []
for c in C:
    A.append(c)
    A.append(c)

for a in A:
    print(a)

Solution (Python):
H, W = tuple(map(int, input().split()))
C = []
for h in range(H):
    C.append([c for c in input()])
res = [["." for _ in range(W)] for _ in range(2*H)]
diff = 0
for h in range(H):
    for w in range(W):
        if C[h][w] == "*":
            res[h+diff][w] = "*"
            res[h+diff+1][w] = "*"
    diff += 1
res = ["".join(x) for x in res]
res = "\n".join(res)
print(res)

Solution (Python):
h, w = (int(x) for x in input().split())

for _ in range(h):
    s = input()
    print(s)
    print(s)

Solution (Python):
H,W = map(int, input().split())

M = []

for _ in range(H):
    temp = input()
    M.append(temp)

for i in range(H):
    print(M[i])
    print(M[i])

Solution (Python):
import sys
input = sys.stdin.readline

def main():
    H, W = map(int, input().split())
    c = [input().strip() for i in range(H)]

    for i in range(H):
        print(c[i])
        print(c[i])

if __name__ == "__main__":
    main()

Solution (Python):
h,w = map(int,input().split())
for _ in range(h):
    c = input()
    print(c)
    print(c)

Solution (Python):
h,w = map(int,input().split())
C = [input().split()*2 for _ in range(h)]
for c in C:
    for p in c:
        print(p)

Solution (Python):
H, W = map(int,input().split())
C = [input() for i in range(H)]
for i in range(H):
    print(C[i])
    print(C[i])

Solution (Python):
H,W = map(int,(input().split()))
array = [input() for _ in range(H)]
for i in range(H):
    print(array[i])
    print(array[i])

Solution (Python):
H, W = map(int, input().split())
C = list(input() for i in range(H))
for i in range(H):
    print(C[i])
    print(C[i])

Solution (Python):
H, W = map(int, input().split())
C = [list(input()) for _ in range(H)]
for c in C:
    print(''.join(c))
    print(''.join(c))

Solution (Python):
h, w = map(int, input().split())
cc = [input() for _ in range(h)]
for c in cc:
    print(c + "\n" + c)

Solution (Python):
h, w = map(int, input().split())
cc = [input() for _ in range(h)]
for c in cc:
    print(c + "\n" +c)

Solution (Python):
H,W=map(int,input().split())
for _ in range(H):C=input();print(C);print(C)

Solution (Python):
h, w = map(int, input().split())
ans = []
for i in range(h):
    c = input()
    ans.append(c)
for i in ans:
    print(i)
    print(i)

Solution (Python):
H, W = map(int, input().split())
C = [input() for _ in range(H)]

for i in range(H):
	print(C[i], C[i], sep='\n')

Solution (Python):



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




for i in range(H):
    
    C = input()
    
    print(C)
    print(C)

Solution (Python):
h, w = map(int, input().split())
pic = [list(input().split()) for _ in range(h)]

for v in pic:
    print(*v)
    print(*v)

Solution (Python):
H,W  = map(int,input().split())
a = []
for i in range(H):
    b = input()
    a.append(b)
    a.append(b)
print(*a,sep="\n")

Solution (Python):
h,w = map(int, input().split())

for i in range(h):
  m =input()
  print(m)
  print(m)

Solution (Python):
H, W = list(map(int, input().split(' ')))
C = [list(input()) for i in range(H)]

for C_list in C:
    print(*C_list, sep='')
    print(*C_list, sep='')

Solution (Python):
h,w = map(int,input().split())
for i in range(h):
    line = input()
    print(line)
    print(line)

Solution (Python):
h,w = map(int,input().split())
rlists = []
for i in range(h):
    yoko = list(input())
    rlists.append(yoko)
    rlists.append(yoko)
for rlist in rlists:
    print(*rlist,sep="")

Solution (Python):
h,w=map(int,input().split())
c=[]
for i in range(h):
    c.append(input())
for i in range(h):
    print(c[i])
    print(c[i])

Solution (Python):
H, _ = map(int, input().split())
for _ in range(H):
	s = input()
	print(s + "\n" + s)

Solution (Python):
H,W = map(int,input().split())
C = [input() for i in range(H)]
for i in C:
  print(i)
  print(i)

Solution (Python):
h,w = map(int,input().split())
matrix = []

for i in range(h):
  matrix.append(list(map(str, input().split())))

for i in range(len(matrix)):
  print(matrix[i][0])
  print(matrix[i][0])

Solution (Python):

import sys


def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

H, W = ISI()
A = [IS() for _ in range(H)]

for i in range(H):
    print(A[i])
    print(A[i])

Solution (Python):
height, wide = map(int, input().split())

for i in range(height):
  c = input()
  print(c)
  print(c)

Solution (Python):
h,w= map(int,input().split())
for i in range(h):
    s = input()
    print(s)
    print(s)

Solution (Python):
h,w = map(int,input().split())
c = [list(input().split())for i in range(h)]

for i in range(2*h):
    print(*c[i//2])

Solution (Python):
h, w = map(int,(input().split()))
a=[input() for i in range(h)]
for i in range(h):
    print(a[i])
    print(a[i])

Solution (Python):
import sys
from collections import Counter

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

mod = 10 ** 9 + 7

h, w = na()
c = []
for i in range(h):
    c.append(input())

for i in range(2 * h):
    ans = ""
    for j in range(w):
        ans += c[i//2][j]
    print(ans)

Solution (Python):
H,W = (int(i) for i in input().split())

X = []
for i in range(H):
    X.append(input())
    
for i in range(H):
    print(X[i])
    print(X[i])

Solution (Python):
def resolve():
    h,w=map(int,input().split())
    for _ in range(h):
        a = input()
        print(a)
        print(a)
resolve()

Solution (Python):
h, w = map(int, input().split())
a = [input() for _ in range(h)]
 
for i in range(h):
    print(a[i])
    print(a[i])

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


H, W = map(int, input().split())
C = []

for i in range(H):
    C.append(input().rstrip())

for c in C:
    print(c)
    print(c)

Solution (Python):
H, W = map(int, input().split())
C = [input() for _ in range(H)]
for i in C:
    print(i)
    print(i)

Solution (Python):
h, w = [int(num) for num in input().split()]
pic = []

for i in range(h):
  pic.append([str for str in input()])

new_pic = []
for one_line in pic:
  new_pic.append("".join(one_line))
  new_pic.append("".join(one_line))

for one_line in new_pic:
  print(one_line)

Solution (Python):
h, w = map(int, input().split())
for i in range(h):
  s = input()
  print(s)
  print(s)

Solution (Python):
h, w = map(int, input().split())
for i in range(h):
  s = input()
  print(s + '\n' + s)

Solution (Python):
H, W = map(int, input().split())

C = [input().split() for _ in range(H)]

print('\n\n')
for i in range(H):
    print(C[i][0], C[i][0], sep="\n")

Solution (Python):
h, w = map(int, input().split())
for i in range(h):
    k = input()
    for j in range(2):
        print(k)

Solution (Python):
h, w = map(int, input().split())
for _ in range(h):
  t = input()
  print(t)
  print(t)

Solution (Python):



H, W = map(int, input().split())
C = [list(map(str, input().split())) for i in range(H)]


for i in range(H):
    ans = C[i] * 2
    for j in range(2):
        print(ans[j])

Solution (Python):
H,W = map(int,input().split())
for i in range(H):
    s = input()
    print(s)
    print(s)

Solution (Python):
def main():
    H, W = map(int, input().split())
    C = []
    for _ in range(H):
        C.append(input())
    D = []
    for i in range(H):
        D.append(C[i])
        D.append(C[i])
    return D

if __name__ == '__main__':
    D = main()
    for i in range(len(D)):
        print(D[i])

Solution (Python):
h, w = map(int, input().split())
c = ['w' * w]
c += [input() for _ in range(h)]

for i in range(1, h * 2 + 1):
    print(c[(i + 1) // 2])

Solution (Python):
h,w = map(int,input().split())
l = []
for i in range(h):
    l.append(input())
for i in range(2 * h):
    print(l[i // 2])

Solution (Python):
h,w=map(int,input().split())
for _ in range(h):
    s=input()
    print(s)
    print(s)

Solution (Python):
h, w = map(int, input().split())

for i in range(h):
    s = input()
    print(s)
    print(s)

Solution (Python):
h,w=map(int,input().split())

for i in range(h):
  s=input()
  print(s)
  print(s)

Solution (Python):
H, W = map(int, input().split())
for i in range(H):
  s = input()
  print(s)
  print(s)

Solution (Python):
h,w=map(int,input().split())
L=[list(input()) for i in range(h)]
for i in range(h,0,-1):
    L.insert(i-1,L[i-1])
for j in range(2*h):
    print(''.join(L[j]))

Solution (Python):
h,w=map(int,input().split())
cl=[[str(i) for i in input()]for i in range  (h)]
for _ in cl:
    print(''.join(_))
    print(''.join(_))

Solution (Python):
H,W=map(int,input().split())
C=[input() for _ in range(H)]

for i in range(H):
  C.insert(2*i+1,C[2*i])
for i in range(2*H):
  print(C[i])

Solution (Python):
H, W = (int(i) for i in input().split())
c = [input() for i in range(H)]
for i in range(H):
    print(c[i])
    print(c[i])

Solution (Python):
h, w = map(int, input().split())
c = [input() for _ in range(h)]

ans = []
for x in c:
    ans.append(x)
    ans.append(x)

for x in ans:
    print(x)

Solution (Python):
h,w=map(int,input().split())
for i in range(h):
    s=input()
    print(s+"\n"+s)

Solution (Python):
h,w = map(int,input().split())
l = []
for i in range(h):
    l.append(input())

for j in range(h):
    print(l[j])
    print(l[j])

Solution (Python):
h,w = map(int,input().split())
ans = []
for i in range(h):
  list = input()
  ans.append(list)
  ans.append(list)
for j in ans:
  print(j)

Solution (Python):
h,w=map(int,input().split())
ans=[]
for i in range(h):
  ans=ans+[input()]*2
for i in range(2*h):
  print(ans[i])

Solution (Python):
h,w=map(int,input().split())
for k in range(h):
    c=input()
    print(c)
    print(c)

Solution (Python):
h,w=input().split()
h,w=int(h),int(w)

s=[]
for i in range(h):
    s.append(input())

for i in range(h):
    print(s[i])
    print(s[i])

Solution (Python):
h, w = map(int, input().split())
l = [input() for _ in range(h)]
for s in l:
    print(s)
    print(s)

Solution (Python):
if __name__ == '__main__':
    H, W = map(int, input().split())
    C = [str(input()) for _ in range(H)]
    C2 = [None for _ in range(2*H)]
    for i, c in enumerate(C):
        C2[2*i] = c
        C2[2*i+1] = c
    for c2 in C2:
        print(c2)

Solution (Python):
h, w = map(int, input().split())
for _ in range(h):
  input_str = input()
  [print(input_str) for _ in range(2)]

Solution (Python):
h,w = map(int, input().split())
C = [input() for _ in range(h)]
for c in C:
    print(c,c,sep="\n")

Solution (Python):
h, w = map(int, input().split())
for i in range(h):
  s = input()
  print(s)
  print(s)

Solution (Python):
h,w = map(int,input().split())
o = [input() for i in range(h)]
n = [[0] * (w) for i in range(2*h)]
for i in range(2*h):
  for j in range(w):
    n[i][j] = o[i//2][j]
  print(''.join(n[i]))

Solution (Python):
h,w=map(int,input().split())
for i in range(h):
  s=input()
  print(s)
  print(s)

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush, heapify
import math
import itertools
import random
 




 
INF = float('inf')
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    H,W = inputMap()
    C = []
    for i in range(H):
        c = input()
        C.append(c)
        
    for i in C:
        print(i)
        print(i)
    
if __name__ == "__main__":
	main()

Solution (Python):
h, w = map(int, input().split())
c = []
for _ in range(h):
    c.append(list(input()))
d = [[""] * w for x in range(h * 2)]
for i in range(h):
    for j in range(w):
        d[i * 2][j] = c[i][j]
        d[i * 2 + 1][j] = c[i][j]
for i in d:
    print("".join(i))

Solution (Python):
H,W = map(int,input().split())
for i in range(H):
    c = input()
    print(c)
    print(c)

Solution (Python):
H , W = map(int,input().split())
for i in range(H):
    l = input()
    print(l)
    print(l)

Solution (Python):
h,w=map(int,input().split())
for i in range(h):
    l=input()
    print(l)
    print(l)

Solution (Python):
h, w = map(int, input().split())
for i in range(h):
  S = input().split()
  print(S[0]+"\n"+S[0])

Solution (Python):
a=list(map(int,input().split()))
for i in range(a[0]):
    b=input()
    print(b)
    print(b)

Solution (Python):
H,W = map(int,input().split())
for _ in range(H):
  c = input()
  print(c)
  print(c)

Solution (Python):
x,y=map(int,input().split())
for _ in range(x):
  s=input()
  print(s)
  print(s)

Solution (Python):
H,W=map(int,input().split())
C= [input() for i in range(H)]
for i in range(H):
    print(C[i]+"\n"+C[i])

Solution (Python):
h, w = map(int, input().split())
a = [tuple(input()) for _ in range(h)]
for i in a:
    print("".join(i))
    print("".join(i))

Solution (Python):
h, w = map(int, input().split())

l = []
for i in range(h):
    l.append(input())

for i in l:
    print(''.join(map(str, i)))
    print(''.join(map(str, i)))

Solution (Python):
h,w = map(int,input().split())
for i in range(h):
    next = input()
    print(next)
    print(next)

Solution (Python):
h,w=map(int,input().split())
c=[input() for i in range(h)]

for i in range(h):
    print(''.join(c[i]))
    print(''.join(c[i]))

Solution (Python):
h,w=map(int,input().split())
for i in range(h):
  s=input()
  print(s+"\n"+s)

Solution (Python):
h,w=map(int,input().split())
for i in range(h):
  s=input()
  print(s+"\n"+s)

Solution (Python):
h, w = map(int, input().split())
c = []
for i in range(h):
    c.append(input())
for i in range(h):
    print(c[i])
    print(c[i])

Solution (Python):
H, W = map(int, input().split())
for i in range(H):
  Cs = input()
  print(Cs)
  print(Cs)

Solution (Python):
h, w = map(int, input().split())
for i in range(h):
  s = input()
  print(s)
  print(s)

Solution (Python):
H, W = map(int, input().split())
ans = []
for i in range(H):
    c = input()
    print(c)
    print(c)

Solution (Python):
H, W = map(int, input().split())

L = [(input()) for _ in range(H)]
for i in range(H):
  print (L[i])
  print (L[i])

Solution (Python):
import math
import sys
from itertools import accumulate
from functools import reduce
import queue
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

sys.setrecursionlimit(10000)

mod = 1000000007

"""

a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654


char_list = list("abcd") 



    = sys.stdin.readline().rstrip()
    = list(sys.stdin.readline().rstrip())
    = [list(list(sys.stdin.readline().rstrip())) for i in range(h)] 


    = int(sys.stdin.readline())
    = map(int, sys.stdin.readline().split())
    = list(map(int, sys.stdin.readline().split()))
    = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  
"""

if __name__ == "__main__":
    h,w = map(int, sys.stdin.readline().split())
    for i in range(h):
        s= input()
        print(s+"\n"+s)

Solution (Python):
h,w=map(int,input().split())
c_ij=[input() for i in range(h)]
ans_ij=[]
for i in range(h):
    ans_ij.append(c_ij[i])
    ans_ij.append(c_ij[i])
print(*ans_ij,sep='\n')

Solution (Python):
h , w = map(int, input().split())
c = []
for i in range(h):
  s = input()
  c.append(s)
  c.append(s)
print("\n".join(c))

Solution (Python):
def main():
    h,w = map(int,input().split())
    for _ in range(h):
        s=input()
        print(s)
        print(s)
    
main()

Solution (Python):
H,W = map(int,input().split(' '))
for i in range(H):
  x = input()
  print(x)
  print(x)

Solution (Python):
h,w=map(int,input().split())
a=[[j for j in input()] for i in range(h)]
for k in a:
    print("".join(k))
    print("".join(k))

Solution (Python):
a,b = map(int,input().split())
for _ in range(a):
  s = input()
  print(s)
  print(s)

Solution (Python):
h, w = map(int, input().split())
c = [list(input().split()) for _ in range(h)]

ans=[]
for i in range(h):
    ans.append(c[i])
    ans.append(c[i])

for i in range(2*h):
    print(''.join(ans[i]))

Solution (Python):
h, w = map(int, input().split())
S = [input() for _ in range(h)]
for s in S:
    print(s)
    print(s)

Solution (Python):
h,w = list(map(int, input().split()))

ans = []
for i in range(h):
    a = input()
    ans.append(a)
    ans.append(a)
for i in ans:
    print(i)

Solution (Python):
H, W = map(int, input().split())

for _ in range(H):
    x = input()
    print(x)
    print(x)

Solution (Python):
h, w = map(int, input().split())
for _ in range(h):
    i = input()
    print(i+"\n"+i)

Solution (Python):
h,w = map(int,input().split())
for i in range(h):
  now = input()
  print(now)
  print(now)

Solution (Python):
h,w = map(int,input().split())
c = []
for i in range(h):
  c.append(input())
for i in range(2*h):
  for j in range(w):
    print(c[(i)//2][j],end="")
    if j == w-1:
      print("\n",end="")

Solution (Python):
H, W = map(int, input().split())
ans = []
for _ in range(H):
    c = input()
    ans.append(c)
    ans.append(c)
for a in ans:
    print(a)

Solution (Python):
H, W = map(int, input().split())
C = [[i for i in input().split()] for i in range(H)]
C_convert = [[0] * W] * 2 * H
for i in range(2 * H):
    C_convert[i] = C[i // 2]

for i in range(2 * H):
    print(*C_convert[i])

Solution (Python):
h, w = map(int, input().split())
dots = []
for i in range(h):
  dots.append(str(input()))
  print(dots[i])
  print(dots[i])

Solution (Python):
h,w = map(int,input().split())
l = [input() for i in range(h)]
for j in range(h):
    print(l[j])
    print(l[j])

Solution (Python):
h,w=map(int,input().split())

queue=[]
for i in range(h):
    queue.append(input())

for i in range(h):
    print(queue[i])
    print(queue[i])

Solution (Python):
high, width = map(int, input().split())
pic = [input() for i in range(high)]

for i in range(high):
    print(pic[i])
    print(pic[i])

Solution (Python):
h,w = map(int,input().split())
c = []
for i in range(h):
    c.append(input())

for i in range(h):
    print(c[i])
    print(c[i])

Solution (Python):
h, w = map(int, input().split())
for i in range(h):
    c = input()
    print(c)
    print(c)

Solution (Python):
H, W = map(int, input().split())
S=[]
for _ in range(H):
    S.append(input())
for i in range(H):
    print(S[i])
    print(S[i])

Solution (Python):
h, w = map(int, input().split())

c = []
for _ in range(h):
    c.append(input())

for i in range(2 * h):
    for j in range(w):
        row = (i + 2) // 2 - 1
        col = j
        print(c[row][col], end='')
    print()

Solution (Python):
h,w=map(int,input().split())
for i in[0]*h:
  a=input()
  print(a);print(a)

Solution (Python):
H, W = map(int, input().split())
cLst = list(input() for i in range(H))
for i in range(H):
    print(cLst[i])
    print(cLst[i])

Solution (Python):
H, W = [int(x) for x in input().split()]

for h in range(H):
    c = input()
    print(c)
    print(c)

Solution (Python):
h, q = map(int, input().split())
s =[]
for i in range(h):
  s.append(input())
for i in s:
  print(i)
  print(i)

Solution (Python):
H, W = map(int, input().split())
ans = [''] * (H*2)
for idx in range(H):
  row = input()
  ans[idx*2] = row
  ans[idx*2+1] = row
for row in ans:
  print(row)

Solution (Python):
H, W = map(int, input().split())
pic = [str(input()) for _ in range(H)]
ans_list = str()
for i in range(1, 2*H+1):
  if i%2 == 0:
    ans_list += pic[int(i/2)-1]
  else:
    ans_list += pic[int((i+1)/2)-1]
for i in range(2*H):
  print(ans_list[i*W:(i+1)*W])

Solution (Python):
x,y = map(int,input().split())
for i in range(x):
  a = input()
  print(a)
  print(a)

Solution (Python):
 
h, w = [int(el) for el in input().split(' ')]
C = [list(input()) for i in range(h)]

for i in range(0, 2*h, 2):
    C.insert(i+1, C[i])

[print(''.join(C[i])) for i in range(2*h)]

Solution (Python):
h, w = map(int, input().split())
c = [str(input()) for _ in range(h)]

for i in range(h*2):
    print(c[i//2])

Solution (Python):





def main():
    h, w = map(int, input().split())
    C = []
    for i in range(h):
        C.append(input())
    
    for i in range(2 * h):
        j = i // 2
        print(C[j])

if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)

from math import factorial



def main():
    high, widdth = map(int, input().split())
    for i in range(high * 2):
        if i % 2 == 0:
            aaa = input()
        print(aaa)







if __name__ == '__main__':
    main()

Solution (Python):
h,w = map(int,input().split())
a = [[i for i in input()] for j in range(h)]
for i in a:
    print("".join(i))
    print("".join(i))

Solution (Python):
H,W=[int(x) for x in input().split()]
for _ in range(H):
  l=input()
  print(l)
  print(l)

Solution (Python):
h,w = map(int,input().split())
l = []
for i in range(h):
  l.append(str(input()))
for i in range(len(l)):
  print(l[i])
  print(l[i])

Solution (Python):
h,w=map(int,input().split())
l=[]
for i in range(h):
  l.append([input()])
l2=[]
for j in range(h):
  l2.append(l[j])
  l2.append(l[j])
for k in range(2*h):
  print(''.join(l2[k]))

Solution (Python):
n, m = list(map(int, input().split()))
a = [list(input()) for _ in range(n)]
for i in range(n):
	print("".join(a[i]))
	print("".join(a[i]))

Solution (Python):
a, b = map(int, input().split())
l = [0]*a
for i in range(a):
    l[i] = input()
    print(l[i])
    print(l[i])

Solution (Python):
h,w = map(int,input().split())
matrix = []
while True:
    try:
        matrix.append(list(map(str,input().split())))
    except:
        break;
for i in range(len(matrix)):
    print(matrix[i][0])
    print(matrix[i][0])

Solution (Python):
h, w = map(int, input().split())
A = []


i = 0
while i < h:
    A = input()
    print(A)
    print(A)
    i += 1

Solution (Python):
h, w = map(int, input().split())
for i in range(h):
    c = input()
    print(c)
    print(c)

Solution (Python):
H, M = map(int, input().split())
src_image = [list(input().split()) for i in range(H)]
for i in range(H):
    print(*src_image[i])
    print(*src_image[i])

Solution (Python):
H, W = map(int,input().split())
src_img = [list(input().split()) for _ in range(H)]
for i in range(H):
    print(*src_img[i])
    print(*src_img[i])

Solution (Python):
H,W = list(map(int,input().split()))
for i in range(H):
  C = input()
  print(C)
  print(C)

Solution (Python):
h,w=map(int,input().split())
paint=[]
for i in range(h):
    a=list(input().split())
    b="".join(a)
    paint.append(b)
    
for i in range(h):
    print(paint[i])
    print(paint[i])

Solution (Python):

import sys


def solve(h, w, a):
    ret = []
    for i in range(h):
        ret.append(a[i])
        ret.append(a[i])
    for r in ret:
        print(r)


def main():
    h, w = map(int, input().split())
    a = []
    for i in range(h):
        a.append(input())
    solve(h, w, a)

if __name__ == '__main__':
    main()

Solution (Python):
H,W = map(int,input().split())

C_original = [ 0 for j in range(H+1)]

for j in range(H):
    C_original[j+1] = input()
for j in range(2*H):
    print(C_original[(j + 1+1)//2])

Solution (Python):
H, W = map(int, input().split())

for i in range(H):
    c = input()
    print(c)
    print(c)

Solution (Python):
H,W=map(int,input().split())
C=[input() for _ in range(H)]
CC=[]
for c in C:
  CC.append(c)
  CC.append(c)
print(*CC,sep="\n")

Solution (Python):
a, b = map(int, input().split())
for i in range(a):
    c = input()
    print(c)
    print(c)

Solution (Python):
H, W = map(int, input().split())
C = []

for i in range(H):
  S = input()
  C.append(S)
  C.append(S)

for i in C:
  print(i)

Solution (Python):
n, m = map(int, input().split())
for i in range(n):
  s = input()
  print(s)
  print(s)

Solution (Python):
H, W = map(int, input().split())
for i in range(0, H):
	s = input()
	print(s)
	print(s)

Solution (Python):
from collections import Counter
from collections import deque
from functools import reduce
from operator import mul
from pprint import pprint
import bisect
import copy
import fractions
import itertools
import math
import queue
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers): return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers): return reduce(LCM, numbers)
def LCM(m, n): return (m * n // fractions.gcd(m, n))
def COMBINATION(n, r):
    if n < 0 or r < 0 or n < r:
        return 0
    r = min(n-r, r)
    if r == 0:
        return 1
    o = reduce(mul, range(n, n - r, -1))
    u = reduce(mul, range(1, r + 1))
    return o // u
class UnionFind():

    def __init__(self, n):
        self.n = n
        self.node = [i for i in range(n)]
        self.size = [1 for _ in range(n)]

    def same(self, x, y):
        return bool(self.root(x) == self.root(y))

    def root(self, x):
        if self.node[x] == x:
            return x
        else:
            self.node[x] = self.root(self.node[x])  
            return self.node[x]

    def unite(self, x, y):
        x, y = self.root(x), self.root(y)
        if x == y:
            return  
        if self.size[x] < self.size[y]:
            x, y = y, x
        self.node[y] = x
        self.size[x] += self.size[y]

    def return_size(self, x):
        return self.size[self.root(x)]


h, w = MI()
c = [IS() for _ in range(h)]
for i in c:
    print(i)
    print(i)

Solution (Python):
h, w = map(int, input().split())
org_list = [input() for _ in range(h)]
new_list = []
for i in org_list:
    new_list.append(i)
    new_list.append(i)
for n in new_list:
    print(n)

Solution (Python):
h, w = map(int, input().split())
c = [input().split() for i in range(h)]

c2 = []

for l in c:
  c2.append(l[:])
  c2.append(l)

for l in c2:
  print(l[0])

Solution (Python):
H,W=map(int,input().split())
for _ in range(H):
	a=input()
	print(a)
	print(a)

Solution (Python):
h,w=map(int,input().split())

l=[input() for _ in range(h)]
for i in range(h):
    print(l[i])
    print(l[i])

Solution (Python):
a, b = map(int, input().split())
for i in range(a):
    c = input()
    print(c)
    print(c)

Solution (Python):
H, W = map(int, input().split())
pixel = []
for _ in range(H):
    pixel.append(input())

for _ in range(H):
    print(pixel[_])
    print(pixel[_])

Solution (Python):

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

for i in range(H):

    C = input()

    print(C)
    print(C)

Solution (Python):
h,w=map(int,input().split())
c=[input()for i in range(h)]

for i in range(h):
    print(c[i])
    print(c[i])

Solution (Python):
h, w = map(int, input().split())
c = [input() for i in range(h)]

for i in c:
    print(i)
    print(i)

Solution (Python):
H, W = map(int, input().split())
C = [[i for i in input()] for _ in range(H)]

C2 = [[''] * W for i in range(H * 2)]

for i in range(H) :
    for j in range(W) :
        i2 = i * 2
        C2[i2][j] = C2[i2+1][j] = C[i][j]
        
for i in range(H * 2) :
    print(''.join(C2[i]))

Solution (Python):
h,w = map(int, input().split())

for i in range(h):
    list = input()
    print(list)
    print(list)

Solution (Python):
H, W = map(int, input().split())
C = [input() for _ in range(H)]

for c in C:
    print(c)
    print(c)

Solution (Python):



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

for i in range(H):
    arr = input()
    print(arr)
    print(arr)

Solution (Python):
def main():
    h,w = map(int,input().split(' '))
    for i in range(h):
        l = input()
        print(l)
        print(l)

if __name__ == '__main__':
    main()

Solution (Python):
h,w=map(int,input().split())
c=[]
for _ in range(h):
    c.append(list(map(str,input())))
    
ans=[c[i//2] for i in range(2*h)]

for j in ans:
    print(''.join(j))

Solution (Python):
h, w = map(int, input().split())
for i in range(h):
    c = input()
    print(c)
    print(c)

Solution (Python):
h,w = map(int,input().split())
for i in range(h):
  s=input()
  print(s)
  print(s)

Solution (Python):
h,w = map(int,input().split())
for i in range(h):
    a = input()
    print(a)
    print(a)

Solution (Python):
from sys import stdin
H,W = [int(x) for x in stdin.readline().rstrip().split()]
C = []
for _ in range(H):
    C.append((input()))
for i in C:
    print(i)
    print(i)

Solution (Python):
h,w=map(int,input().split())
graph=[]
for _ in range(h):
    graph.append(input())

for c in graph:
    print(c)
    print(c)

Solution (Python):


h,w = map(int,input().split())
c = [list(input()) if i % 2 == 0 else [] for i in range(2*h)]

for i in range(h):
    c[2*i+1] = c[2*i]
for i in range(2*h):
    print(''.join(c[i]))

Solution (Python):
h, w = map(int, input().split(" "))
for i in range(h):
    a = input()
    print(a)
    print(a)

Solution (Python):
h,w = map(int,input().split())
for i in range(h):
    s = str(input())
    print(s)
    print(s)

Solution (Python):
h,w = map(int,input().split())
lst = []
for i in range(h):
    s = input()
    lst.append(s)
    lst.append(s)
for i in range(2*h):
    print(lst[i])

Solution (Python):
H, W = map(int, input().split())
for _ in range(H):
    line = input()
    print(line)
    print(line)

Solution (Python):
a = list(map(int,input().split()))
for i in range(a[0]):
  b = input()
  print(b)
  print(b)