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())
pic = []
for _ in range(h):
    pic.append(input())
for line in pic:
    print (line)
    print (line)

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

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

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

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

Solution (Python):



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

L = []

for i in range(h):
    c = input()
    L.append(c)
    L.append(c)

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

Solution (Python):
H,W=map(int,input().split())
c=[input()for _ in range(H)]
for h in range(2*H):
    for w in range(W):
        print(c[h//2][w],end='')
    print()

Solution (Python):


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

    c = [0]*H
    for i in range(H):
        c[i] = input()
    

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

main()

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

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

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

for i in range(2*h):
    
    if i % 2 == 0:
        print(*c[i//2],sep="")
    else:
        print(*c[(i-1)//2],sep="")

Solution (Python):
import numpy as np
H,W = [int(i) for i in input().split()]

C = np.zeros([1,H],dtype = object)

for i in range(H):
    C[0,i] = str(input())
    
C_d = np.zeros([1,2*H],dtype = object)

for i in range(2*H):
    C_d[0,i] = C[0,int(i//2)]
    
for i in range(2*H):
    print(C_d[0,i])

Solution (Python):


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

pic = []

for i in range(H):
    row = input()
    pic.append(row)

for i in range(H):
    for j in range(2):
        print(pic[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):
    for _ in range(2):
        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 = map(int, input().split())
for i in range(H):
    s = input()
    print(s)
    print(s)

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 _ in range(H):
    s = input()
    print(s)
    print(s)

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

Solution (Python):
l = input().split(' ')
H = int(l[0])
for i in range(H):
  line = input()
  print(line)
  print(line)

Solution (Python):

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

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

Solution (Python):


H,W = list(map(int, input().rstrip().split()))
C_list = [input().strip() for _ in range(H)]


for i in range(H):
    for x in range(2):
        print(C_list[i])

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

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

Solution (Python):
import sys









mod = int(1e9+7)
INF = 1<<29

def main():
    h,w = map(int,input().split())
    c = []
    for i in range(h):
        x = list(input().split())
        c.append(x)
    for i in range(h):
        print(''.join(c[i]))
        print(''.join(c[i]))
    return

if __name__=='__main__':
    main()

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

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

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

for j in range(2*h):
    print(x[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())
c = [str(input()) for _ in range(h)]


c_new = []
for j in c:
    for k in range(2):
        c_new.append(j)

print("\n".join(c_new))

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

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

lst1 = [readline().rstrip().decode('utf-8') for i in range(h)]
for i in range(h):
    for j in range(2):
        print(lst1[i])

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

Solution (Python):

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

for i in range(h):
    tmp = list(c[i])
    for j in range(w - 1):
        print(tmp[j], end = '')
    print(tmp[w - 1])
    for j in range(w - 1):
        print(tmp[j], end = '')
    print(tmp[w - 1])

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

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

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

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

for i in range(2*H) :
    print("".join(S[i//2]))

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

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

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()
    for j in range(2):
        print(c)

Solution (Python):
def main():
    H, W = map(int, input().split())
    c_matrix = [input() for _ in range(H)]
    ans = []
    for c_row in c_matrix:
        ans.append(c_row)
        ans.append(c_row)
    print("\n".join(ans))

if __name__ == '__main__':
    main()

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

Solution (Python):
def I(): return int(input())
def MI(): return map(int, input().split())
def LMI(): return list(map(int, input().split()))
MOD = 10 ** 9 + 7


H, W = MI()
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())
for i in range(h):
    pix=input()
    print(pix,pix,sep="\n")

Solution (Python):
def main():
    height, width = map(int, input().split())
    image = [input() for _ in range(height)]
    for img in image:
        for _ in range(2):
            print(img)


if __name__ == '__main__':
    main()

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

for i in c:
    print(i)

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

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

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

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())
l = [list(input()) for i in range(h)]
for i in range(2*h):
    for j in range(w):
        print(l[i//2][j],end="")
    print()

Solution (Python):


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


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

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

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

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=[input() for _ in range(h)]
for i in range(h):
  print(c[i]+'\n'+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())
C = []
for _ in range(H):
    C.append(input())

for c in C:
    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())
C=[input().split() for i in range(H)]
ans=[]
for i in range(H):
    ans.append(C[i])
    ans.append(C[i])
for j in range(len(ans)):
    print(*ans[j])

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

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

for i in l:
    print(i)
    print(i)

Solution (Python):
h, w = map(int, input().split())
grid = [input() for _ in range(h)]
for i in range(h):
    print(grid[i])
    print(grid[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())
input_li = [input() for i in range(H)]
for h in range(H) :
    print(input_li[h])
    print(input_li[h])

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 = [list(input()) for _ in range(h)]

for i in c:
    print("".join(i))
    print("".join(i))

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

ans=[]
for i in range(H-1):
    ans.append(C[i])
    ans.append(C[i])

ans.append(C[H-1])
ans.append(C[H-1])

for i in range(len(ans)):
    s=""
    for j in range(len(ans[i])):
        s+=s+ans[i][j]
    print(s)

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

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

Solution (Python):
import copy
h, w = list(map(int, input().split()))
p = [input().split() for _ in range(h)]
ans = copy.deepcopy(p)
for i in range(h):
  ans.insert(i*2, p[i])
for i in range(h*2):
  print(ans[i][0])

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

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

for h in range(H):
    print(''.join(C[h]))
    print(''.join(C[h]))

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

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

Solution (Python):
import numpy as np
H,W=map(int,input().split())
c=[list(input()) for _ in range(H)]
wide=np.zeros((H*2,W)).tolist()


for i in range(H):
    for j in range(W):
        wide[2*i][j]=c[i][j]
        wide[2 * i+1][j] = c[i][j]

for i in wide:print(*i, sep='')

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

for i in range(h):
    buf = input()
    c.append(buf)
    c.append(buf)

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

Solution (Python):
H,W = [int(i) for i in input().split()]
pic = ['0'] * H
pica = ['0'] * (2*H)
for i in range(H):
    pic[i] = list(input())
for i in range(2*H):
    if i !=0:
        pica[i] = pic[(i+1)//2 - 1]
    else:
        continue
for i in range(1,2*H):
    k = pica[i]
    pica[i-1] = k
for i in range(2*H):
    k = ''.join(pica[i])
    print(k)

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

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

for hw in hwl:
    print(hw)
    print(hw)

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 = map(int,input().split())

output = []
for _ in range(H):
  s = input()
  output.append(s)
  output.append(s)

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

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

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

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())
S=[]
for _ in range(a):
    S.append(input())
for i in S:
    print(i)
    print(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())
A = [input() for _ in range(H)]
for i in range(H):
    print(A[i])
    print(A[i])

Solution (Python):
a = []
for i in range(int(input().split()[0])):
    a.append(input())
for i in a:
    print(i)
    print(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):




def main():
    H, W = map(int, input().split())
    for _ in range(H):
        C = input()
        print(C + '\n' + C)


if __name__ == "__main__":
    main()

Solution (Python):


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

print("\n".join(s))

Solution (Python):
from itertools import chain

H, W = [int(n) for n in input().split()]

def main():
    c = [input() for _ in range(H)]
    c2 = list(chain.from_iterable(zip(c, c)))
    print('\n'.join(c2))

if __name__ == '__main__':
    main()

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

Solution (Python):
n,l=map(int,input().split())
a = [input() for i in range(n)]
r=[]
for x in a:
    r.append(x)
    r.append(x)
for x in r:
    print("".join(x))

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

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 s in C:
    print(s)
    print(s)

Solution (Python):
"""
author : halo2halo
date : 2, Feb, 2020
"""

import sys




read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

mod = 10 ** 9 + 7

H,W = map(int, readline().split())
S=read().decode('Utf8').split()
for i in S:
    print(i)
    print(i)

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

moji = []
for _ in range(H):
    moji.append(input())

for m in moji:
    print(m)
    print(m)

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 = [int(i) for i in input().split()]

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

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

l = []

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

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

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

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

    for _ in range(h):
        str_list = list(input().split())
        print(*str_list)
        print(*str_list)

if __name__ == '__main__':
    main()

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 = [list(input()) for i in range(h)]
a=[[] for i in range(h*2)]

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

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

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

Solution (Python):
def solve(h, w, C):
    for line in C:
        print('{0}\n{0}'.format(line))

_h, _w = map(int, input().split())
_C = [input() for _ in range(_h)]
solve(_h, _w, _C)

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 _ in range(H):
  S = input()
  print(S)
  print(S)

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

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

for i in range(h):
    output.append(pixcels[i])
    output.append(pixcels[i])

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

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

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 = [int(i) for i in input().split()]
for i in range(H):
    mank = input()
    print(mank)
    print(mank)

Solution (Python):
H,W=map(int,input().split())
L=[[j for j in input()] for i in range(H)]
J=L
for i in range(H):
    print("".join(L[i]))
    print("".join(J[i]))

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())
c = list(input() for _ in range(h))

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

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

lines = []
for _ in range(H):
    line = input()
    lines.append(line)
    lines.append(line)
print('\n'.join(lines))

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

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

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

for i in p:
    for n in range(2):
        print(i)

Solution (Python):

import sys
INF = float("inf")


def main():
    H, W = map(int, input().split())
    C = [input() for _ in range(H)]
    for i in range(2*H):
        buf = []
        for j in range(W):
            buf.append(C[i//2][j])
        print("".join(buf))


if __name__ == '__main__':
    main()

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

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


c = [['-'] * w for i in range(h)]

for i in range(h):
    arr = input()
    arr = list(arr)
    c[i] = arr

x = [['-'] * w for i in range(2*h)]

for i in range(h):
    x[i*2] = c[i]
    x[i*2+1] = c[i]

for i in range(2*h):
    for j in range(w):
        print(x[i][j],end='')
    print('')

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

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

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

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

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

b = []
c =[]

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

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

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

Solution (Python):


def main():
    h, w = map(int, input().split())
    strings = [input() for _ in range(h)]
    for i in strings:
        print(i)
        print(i)
main()

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, = [input().strip() for _ in range(H)]
for v in c:
    print(v)
    print(v)

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

for i in range(H):
    print(tmp[i])
    print(tmp[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())
c = [input() for _ in range(H)]

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

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    ans=[]
    h,w=INTM()
    for i in range(h):
        temp=STR()
        ans.append(temp)
        ans.append(temp)
    for i in range(2*h):
        print(*ans[i],sep='')
if __name__ == '__main__':
    do()

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

for c in cl:
    print('{}\n{}'.format(c, c))

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 _ in range(h):
  l=input()
  print(l)
  print(l)

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

for y in range(H * 2):
    print(C[y // 2])

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

Solution (Python):
import sys
input = sys.stdin.readline
H, W = [int(x) for x in input().split()]
C = []
for _ in range(H):
    C.append(input().rstrip())
for i in C:
    for _ in range(2):
        print(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())
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())
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())

pixels = []

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

for pixel in pixels:
  print(pixel)
  print(pixel)

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

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

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

for l in board:
    print(l)
    print(l)

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

image = []

for _ in range(H):
  image.append(input())

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

Solution (Python):
h,w = map(int,input().split())
c = [list(map(str,input().split())) for _ 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):
  input_string = str(input())
  print(input_string)
  print(input_string)

Solution (Python):

a = input().split(" ")[0]
for a in range(int(a)):
  b = input()
  print(b)
  print(b)

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

for p in pic:
    print("".join(p))
    print("".join(p))

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

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

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

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):
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())
L=[list(input()) for _ in range(h)]
for l in L:
    print(*l,sep='')
    print(*l,sep='')

Solution (Python):
data_num = [int(i) for i in input().split(" ")]
data = [input() for i in range(data_num[0])]
for i in data:
  print(i)
  print(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())
for i in range(H):
  c = str(input())
  print(c)
  print(c)

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

C = []

for _ in range(H):
    l = list(input())
    C.append(l)
D = []
for i in range(2*H):
    l = []
    for j in range(W):
        l.append(C[i//2][j])

    D.append(l)

for i in range(len(D)):
    print(*D[i],sep="")

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

c = []
for i in range(h):
   tmp = [x for x in input()]
   c.append(tmp)

for i in range(h):
   tmp = [print(x, end='') for x in c[i]]
   print()
   tmp = [print(x, end='') for x in c[i]]
   print()

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

Solution (Python):

 
import math
import itertools
import sys
import copy
 

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

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


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

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

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

for a in range(H):
    print(*Clist[a])
    print(*Clist[a])

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

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

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

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

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())
s = [input() for _ in range(h)]
ans=[]
for i in range(h):
    ans.append(s[i])
    ans.append(s[i])
for i in range(h*2):
    print(ans[i])

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

for i in range(a):
  print(" ".join(l[i]))
  print(" ".join(l[i]))

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

Solution (Python):
import sys
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())

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)]
ans = []
for i in range(h):
    ans.append(c[i])
    ans.append(c[i])
for i in range(2 * h):
    print(*ans[i], sep='')

Solution (Python):
[print("{}\n{}".format(i, i)) for i in [input() for _ in range(list(map(int, input().split())).pop(0))]]

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

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf')
ans = 0 ;count = 0 ;pro = 1

h,w=map(int,input().split())
data=[""]*(2*h)
for i in range(0,2*h,2):
    data[i]=input()
for i in range(0,2*h,2):
    data[i+1]=data[i]
print(*data,sep="\n")

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

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