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):
H, W = map(int, input().split())
Ch = [input() for _ in range(H)]
for C in Ch:
    print(C)
    print(C)

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

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

for i in range(h):
    c = input()
    print(c, c, sep='\n')

Solution (Python):

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

C = [''] * H
for i in range(H):
    C[i] = input()
    
C2 = [''] * 2 * H
for i in range(1, 2 * H + 1):
    for j in range(W):
        C2[i - 1] += C[(i + 1) // 2 - 1][j]

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

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

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

Solution (Python):
exec('print((input()+chr(10))*2,end="")\n'*int(input().split()[0]))

Solution (Python):
h,w=input().split();exec('print((input()+chr(10))*2,end="")\n'*int(h))

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

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

for x in c:
    print(x)
    print(x)

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

Solution (Python):
H,W = map(int,input().split())
anss = []
for h in range(H):
   Ws=input()
   anss.append(Ws)
   anss.append(Ws)
for ans in anss:
    print(ans)

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

C = []
for i in range(H):
    C.append(list(input()))

for i in range(2 * H):
    R = []
    for j in range(W):
        R.extend(C[i // 2][j])
    print(''.join(R))

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


if __name__ == "__main__":
    main()

Solution (Python):
def double(x):
    print(x)
    print(x)

h,w = map(int,input().split())

pic = [list(map(str,input().split())) for i in range(h)]

for i in range(h):
    double(pic[i][0])

Solution (Python):
H,W=map(int,input().split())
S=[input() for _ in range(H)]
[print(s+'\n'+s) for s in S]

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

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

Solution (Python):


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

List=[list(input()) for i in range(H)]
for i in range(H):
    str=""
    for j in range(W):
        str+=List[i][j]
    
    print(str)
    print(str)

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

ans = []

for i in range(2*H):
    ans.append(S[i//2])

print(*ans, sep='\n')

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())
s = [str(input()) for i in range(h)]
for i in range(h):
    print(s[i])
    print(s[i])

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

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

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

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

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

Solution (Python):
H, W = map(int, input().split())
C = [input() for _ in range(H)] 
for c in C:
	print("{}\n{}".format(c,c))

Solution (Python):
for i in range(int(input().split()[0])): print((lambda s: s + '\n' + s)(input()))

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

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())
_input = []
for i in range(H):
    row = list(map(str,input().split()))
    _input.append(list(row[0]))

for i in range(2*H):
    row = ""
    for j in range(W):
        row += _input[int(i/2)][j]
    print(row)

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

for i in range(H):
  Dij.append(Cij[i])
  Dij.append(Cij[i])

for i in Dij:
  print(i)

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

Solution (Python):
h,w = map(int, input().split())
listA = [input() for i in range(h)]
for i in range(h):
  print(listA[i]+"\n"+listA[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())
for k in range(h):
  s=input()
  print(s)
  print(s)

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

ans = ""
for i in range(2 * H):
    for j in range(W):
        ans += Cs[i//2][j]
    if i != 2 * H - 1:
        ans += "\n"

print(ans)

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

for x in c:
    print(''.join(x))
    print(''.join(x))

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

for i in range(h):
    line.append(input())

for i in range(len(line)):
    print(line[i])
    print(line[i])

Solution (Python):
""" AtCoder """

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

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

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

Solution (Python):
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy

def j(q):
    if q==1: print("YES")
    else:print("NO")
    exit(0)


def ct(x,y):
    if (x>y):print("GREATER")
    elif (x<y): print("LESS")
    else: print("EQUAL")

def ip():
    return int(input())


def calculate(a):
    s = 0
    for i in range(len(a)):
        for k in range(i+1,len(a)):
            s+=(a[i]*a[k])
    return s


n,m= (int(i) for i in input().split())      










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

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())
for i in range(h):
    s = input()
    print(s)
    print(s)

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

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

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

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

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

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

Solution (Python):
for i in open(0).readlines()[1:]:print(i+i)

Solution (Python):
print(*[i*2for i in open(0).readlines()[1:]])

Solution (Python):
for i in open(0).readlines()[1:]:print(i+i[:-1])

Solution (Python):
for i in open(0).readlines()[1:]:print(i+i,end='')

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

for np in n_pixel:
    print(''.join(np))

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

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

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

D = [C[int(k/2)] for k in range(h*2)]
for d in D:
    print(d)

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):
  c = input()
  print(c)
  print(c)

Solution (Python):

H, W = map(int, input().split())
for i in range(2 * H):
    if i % 2 == 0:
        s = input()
    print(s)

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):
    c=input()
    print(c)
    print(c)

Solution (Python):


import sys

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


h, w = LI()
for _ in range(h):
    s = SI()
    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])
  print(c[i])

Solution (Python):
H, W = [int(x) for x in input().split()]
C = []
for i in range(H):
  C.append(input())
  
for i in range(2 * H):
  print(C[i // 2])

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())

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

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

Solution (Python):


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

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

for r in C:
    print(r)
    print(r)

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

Solution (Python):
h, _ = 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):
    C = input()
    print(C)
    print(C)

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

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

for map in MAPS:
    print('w'.join(map).replace('w',''))
    print('w'.join(map).replace('w',''))

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**7) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

h,w = li()
ss = [ns() for _ in range(h)]

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

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

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

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

Solution (Python):
H,_=input().split()
for _ in [0]*int(H):s=input();print(s+"\n"+s)

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

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

Solution (Python):
s,t=map(int,input().split())
A,B=[input().split() for r in range(s)],[]
for x in A:
  for y in range(2):B.append(x)
for g in B:
  print(g[0])

Solution (Python):


H, W = map(int, input().split())
for i in range(H):
  line = input()
  print('{}\n{}'.format(line, line))

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

for cc in c:
        for _ in range(2):
                print(cc)

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

Solution (Python):
h,w = list(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):
    a = input()
    print(a)
    print(a)

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

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

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

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

for i in range(H):
    row = pixels[i]
    for pixel in row:
        print(pixel, end="")
    print()
    for pixel in row:
        print(pixel, end="")
    print()

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 = []
for i in range(h):
    l = list(input())
    c.append(l)
for i in range(h):
    for k in range(2):
        for j in range(w-1):
            print(c[i][j],end='')
        print(c[i][w-1])

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

Solution (Python):
h, w = map(int, input().split())
listCSeq=[]
index=0
while index < h:
    seq = input()
    listCSeq.append(seq)
    index+=1

for seq in listCSeq:
    print(seq)
    print(seq)

Solution (Python):
def execute(h, w, c):
    result = []
    for ci in c:
        result.append(ci)
        result.append(ci)
    return result


if __name__ == '__main__':
    h, w = map(int, input().split())
    c = []
    for _ in range(h):
        c.append(input())
    for ci in execute(h, w, c):
        print(ci)

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

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

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

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

Solution (Python):
H,W = map(int,input().split())
A = []
for i in range(H):
    A.append(str(input()))
for i in range(H):
    for j in range(2):
        print(A[i])

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

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

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

Solution (Python):
a,b=map(int,input().split())
s=[]
for i in range(a):
    d=input()
    s.append(d)
    s.append(d)
for i in range(2*a):
    print(s[i])

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

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

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

Solution (Python):

H, W = [int(x) for x in input().split()]
for i in range(H):
    s = input()
    print(s)
    print(s)

Solution (Python):


def main():
    """Function."""
    h, w = map(int, input().split())
    for i in range(h):
        line = str(input())
        print(line)
        print(line)

if __name__ == "__main__":
    main()

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

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

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())
for i in range(h):
    s=input()
    print(s+"\n"+s)

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

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

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

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

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

Solution (Python):
[f(input())for _ in range([int(i) for i in input().split()][0]) for f in [lambda x:print(x,x,sep='\n')]]

Solution (Python):
H,W = map(int,input().split())
s = [input() for i in range(H)]
figure = ["".join([s[i//2][j-1] for j in range(1,W+1)]) for i in range(2*H)]
for line in figure:
    print(line)

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

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

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

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

Solution (Python):
h, w = [int(x) for x in input().split()]
for i in [input() for x in [0] * h]:
    print(i + '\n' + i)

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

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

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())
S = [input() for _ in range(h)]
for s in S:
  print(s)
  print(s)

Solution (Python):
int_h, int_w = map(int, input().split())

li_px = list()

for i in range(int_h):
    li_px.append(list(input().split()))

for l in li_px:
    print("".join(l), "".join(l), sep="\n")

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

Solution (Python):
a, b = map(int, input().split())

A = []
for i in range(a):
    A.append(input())

for j in range(a):
        print(A[j])
        print(A[j])

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

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

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

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 = []
for i in range(H):
    C.append(list(input()))




for j in range(len(C)):
    print(''.join(C[j]))
    print(''.join(C[j]))

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

for k in range(len(C)):
    C.insert(-1-2*k, C[-1-2*k])

for j in range(len(C)):
    print(''.join(C[j]))

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

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

Solution (Python):
temp = input().rstrip().split(" ")
H = int(temp[0])
list = []
for i in range(H):
    list.append(input().rstrip())
    for j in range(2):
        print(list[i])

Solution (Python):


h,w=map(int,input().split())

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

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

result = []
for _ in range(H):
  c = input()
  result.append(c)
  result.append(c)
for r in result:
  print(r)

Solution (Python):
def main():
    h, _ = map(int, input().split())
    coord = [''] * (h * 2 + 1)
    for y in range(1, h + 1):
        coord[y] = input()

    for y in range(h, 0, -1):
        coord[y * 2] = coord[y]
        coord[y * 2 - 1] = coord[y]

    for row in coord[1:]:
        print(row)


if __name__ == '__main__':
    main()

Solution (Python):
h, w = map(int, input().split())
c = []
for i in range(h):
    c.append([str(m) for m in list(input())])
for i in range(2 * h):
    if i != 0:
        print()
    for j in range(w):
        print(c[i // 2][j], sep = "", end = "")

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 = []
for i in range(h):
    c.append(input())

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

Solution (Python):
h, w = [int(i) for i in 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):
    a = input()
    print(a)
    print(a)

Solution (Python):
h,w = map(int, input().split())
stage = [[list(input())]*2 for i in range(h)]
for i in stage:
    for j in i:
        for k in j:
            print(k,end = "")
        print()

Solution (Python):
line = input().split()
h = int(line[0])
w = int(line[1])
comp = []

for i in range(h):
    n = input()
    comp.append(n)
    comp.append(n)

for i in comp:
    print(i)

Solution (Python):
H, W = map(int, input().split())
s_arr = []
for _ in range(H):
    s_arr.append(input())
for s in s_arr:
    print(s)
    print(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())
C=[""]*(2*h)
for i in range(0,h*2,2):
  C[i]=input()
  if i+1 <=len(C):
    C[i+1]=C[i]
for i in C:
  print(i)

Solution (Python):
H, W = map(int, input().split())
original = [list(input()) for i in range(H)]
for i in range(2 * H):
    print(''.join(original[i // 2][:]))

Solution (Python):
H, W = map(int, input().split())
original = [list(input()) for i in range(H)]
converted = [[0 for j in range(W)] for i in range(2 * H)]
for i in range(2 * H):
    for j in range(W):
        converted[i][j] = original[i // 2][j]
        
for row in converted:
    print(''.join(row))

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

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

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

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

for l in line:
    print(l)
    print(l)

Solution (Python):
height, width = map(int, input().split())
c = []
for _ in range(height):
    c.append(input())

for i in range(height):
    print(c[i] + "\n" + c[i])

Solution (Python):
height, width = map(int, input().split())
c = []
for _ in range(height):
    c.append(input())

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

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

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

for i in range(H):
    s = input().rstrip()
    print(s)
    print(s)

Solution (Python):

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

for _ in range(H):
    l = input()
    print(l, l, sep="\n")

Solution (Python):

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

for _ in range(H):
    l = input()
    print(l + "\n" + l)

Solution (Python):

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

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

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

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

ans = []

for i in range(2*H):
    row = ''
    for j in range(W):
        row += C[i//2][j]
    ans.append(row)

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

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 = []
for n in range(h):
    c.append(list(input()))

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

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())
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())
stage = [list(input()) for i in range(h)]
ans = [0 for i in range(2*h)]
for i in range(h):
    ans[2*i] = stage[i]
    ans[2*i+1] = stage[i]
for i in ans:
    for j in i:
        print(j, end = "")
    print()

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

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

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, raw_input().split())
res = []
for i in range(H):
    res.append(raw_input())
for i in res:
    print i
    print i

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

Solution (Python):
H, W = map(int, input().split())
STR = []
for i in range(H):
    s = str(input())
    STR.append(s)
    STR.append(s)
print("\n".join(STR))

Solution (Python):

h, w = (int(_) for _ in input().split())
c = [input() for i in range(h)]

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

for i in ans:
    print(i)

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

Solution (Python):
[h,w] = [int(i) for i in input().split()]
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())
s = []
for _ in range(h):
    c = input()
    s.append(c+"\n"+c)
print('\n'.join(s))

Solution (Python):
i,p=input,print;H,W=map(int,i().split())
for j in range(H):k=i();p(k);p(k)

Solution (Python):
for i in[0]*int(input().split()[0]):print('\n'.join([input()]*2))

Solution (Python):
i,p=input,print;H,W=map(int,i().split())
for j in range(H):
    k=i();p(k);p(k)

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

Solution (Python):
for i in [0]*int(input().split()[0]):print('\n'.join([input()]*2))

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

Solution (Python):
HW = [int(_) for _ in input().split()]
C = [input() for _ in range(HW[0])]
for i in range(HW[0]):
    print(C[i])
    print(C[i])

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

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

Solution (Python):
i,j=map(int,input().split())
a=[]
for x in range(i):
	b=input()
	a.append(b)
	a.append(b)
for x in range(2*i):
	print(a[x])

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

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

for i in li:
    for z in range(2):
        print(i)

Solution (Python):
import numpy as np
from sys import stdin


def main():
    h = next_int()
    w = next_int()

    c = np.array([input() for _ in range(h)])

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


def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin


def main():
    h = next_int()
    w = next_int()

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

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


def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Solution (Python):
a = input().split(" ")
ar = []
for i in range(int(a[0])):
    l = input()
    ar.append(l)
for j in ar:
    print(j)
    print(j)

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

Solution (Python):



"""
縦 H ピクセル、横 W ピクセルの画像があります。
全てのピクセルは . または * で表されるものとします。
上から i 番目、左から j 番目のピクセルを表す文字を Ci,j で表します。

この画像を 2 倍縦長にした画像を出力してください。
すなわち、縦 2H ピクセル、横 W ピクセルの画像であって、
上から i 番目、左から j 番目のピクセルは、
C(i+1)⁄2,j (ただし、割り算は切り捨て)と等しい画像を出力してください。
"""

test_mode = False

H, W = map(int, input().split())
img = [0]
img_2x = ['0' for _ in range(H*2 +1)]  

for _ in range(H):
    img.append(input())
    if test_mode:
        print(img)

for i in range(1, H*2 +1):
    if test_mode:
        print('i =', i)
    k = (i+1)//2
    img_2x[i] = img[k]
    print(img_2x[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())
c = [input() for _ 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())
for _ in [0]*h:
  a = input()
  print(a+"\n"+a)