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())
C = [input() for _ in range(H)]
ans = [[0]*W for _ in range(2*H)]

for i in range(2*H):
  for j in range(W):
    ans[i][j] = C[i//2][j]
  print(*ans[i], sep="")

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


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

    for c in C:
        print(c)


if __name__ == '__main__':
    resolve()

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

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

res = [0 for i in range(H*2)]

for i in range(0,H):
    res[(i+1)*2-1] = ab[i]
    res[(i)*2] = ab[i]

for j in range(0,H*2):
    print(res[j])

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):
def resolve():
    h,w=map(int, input().split())
    for i in range(h):
        a=input()
        print(a)
        print(a)
resolve()

Solution (Python):
H = int(list(input().split())[0])
for i in range(H):
  S = input()
  print(S)
  print(S)

Solution (Python):
H = int(list(input().split())[0])
for i in range(H):
  S = input()
  print(S)
  print(S)

Solution (Python):
n,m = map(int,input().split())
def pr(a):
    print(a)
    print(a)

for i in range(n):
    pr(input())

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

Solution (Python):
x, y = map(int,input().split())
ans = []

for i in range(x):
    s = input()
    ans.append(s)
    ans.append(s)

for i in ans:
    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())

List = [list(map(str,input().split())) for i in range(H)]
for i in range(len(List)):
    print(List[i][0])
    print(List[i][0])

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 = map(int,input().split())
ans = []
for _ in range(H):
    C = input()
    ans.append(C)
    ans.append(C)
for i in range(2 * H):
    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())
C = [list(input()) for _ in range(H)]

A = [[""]*W for _ in range(2*H)]
for i in range(2*H):
    for j in range(W):
        A[i][j] = C[i//2][j]

for a in A:
    print("".join(a))

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
MOD = 10**9+7
INF = float('inf')

def main():
    H, W = map(int, readline().split())
    for _ in range(H):
        s = input()
        print(s)
        print(s)





if __name__ == '__main__':
    main()

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

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

Solution (Python):
l = [int(x) for x in input().split()]
h = l[0]
for i in range(h):
    c = input()
    print(c)
    print(c)

Solution (Python):
H,W=map(int,input().split())
list=[]
for i in range(H):
    A=input()
    list.append(A)
for i in range(H):
    print(list[i])
    print(list[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())
c_inputs = [input() for i in range(h)]

for line in c_inputs:
    print(line+'\n'+line)

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

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

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


if __name__ == '__main__':
    main()

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


for l in list_score:
    print("".join(l))
    print("".join(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())
al = [input() for _ in range(h)]

res = []
for a in al:
    res.append(a)
    res.append(a)

for a in res:
    print(a)

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

for i in range(H):
    C = list(map(str, input().split()))

    print(''.join(C))
    print(''.join(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 = map(int,input().split())
board = [[] for _ in range(H*2)]
for i in range(H):
    board[2*i] = list(input())
    board[2*i+1] = board[2*i].copy()


for row in board:
    print(*row,sep="")

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

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

for i in p:
    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])
    print(C[i])

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

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

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

Solution (Python):
def resolve():
	h, w = map(int, input().split())
	img = []
	ex_img = [[False]*w for _ in range(h*2)]
	for i in range(h):
		r = list(input())
		img.append(r)
	for i in range(h*2):
		for j in range(w):
			ex_img[i][j] = img[i//2][j]
	for i in range(h*2):
		print("".join(ex_img[i]))
resolve()

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])
    
print(*ans,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 = list(map(int, input().split()))
c = [input() for i in range(h)]

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

Solution (Python):
def solve(h, w, grid):
    result = []
    for row in grid:
        curSring = "".join(row)
        result.append(curSring)
        result.append(curSring)
    for row in result:
        print(row)


H, W = map(int, input().split())
grid = []
for _ in range(H):
    grid.append(list(input()))
solve(H, W, grid)

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 [0]*h:
    c = input()
    print(c)
    print(c)

Solution (Python):
H,W = [int(x) for x in 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())
lsts=[]
for _ in range(H):
  lsts.append(list(input()))
for lst in lsts:
  print(''.join(lst))
  print(''.join(lst))

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

h, w = map(int, readline().split())
for i in range(h):
    c = readline().rstrip().decode()
    print(c + '\n' + c)

Solution (Python):
def myAnswer(H:int,W:int,C:list) -> None:
   for c in C:
      print(c)
      print(c)

def modelAnswer():
   tmp=1

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

if __name__ == '__main__':
   main()

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

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

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

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

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

for line in p:
    print(line)
    print(line)

Solution (Python):

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

for line in lines:
    print(line)
    print(line)

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

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

Solution (Python):
nim,mike = map(int, input().split())
for i in range(nim):
    data = input()
    print(data)
    print(data)

Solution (Python):
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

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

Solution (Python):
h , w = map(int , input().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())
li = []
for i in range(H):
  li.append(list(input()))

li2 = []
for k in range(H*2):
  li2.append(li[k//2])

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

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

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

h, w = na()
c = nsn(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):
    l = input()
    print(l)
    print(l)

Solution (Python):
H,W = map(int,(input().split()))
List = [list(map(str,input().split())) for i in range(H)]
n = 0
for i in range(H*2):
  if(i % 2 == 0):
    List2 = List[n]
    for a in List2:
      if(n != 0):
        print("")
        print(a,end = "")
      else:
        print(a,end = "")
  else:
    List2 = List[n]
    for a in List2:
      print("")
      print(a,end = "")
      n += 1

Solution (Python):
def main():
    H, W = map(int, input().split())
    org = list()
    expand = [[ 0 for w in range(W)] for h in range(2*H) ]

    for _ in range(H):
        l = input()
        org.append(l)

    for i in range(2*H):
        for j in range(W):
            expand[i][j] = org[i//2][j]

    for i in range(2*H):
        for j in range(W):
            print(expand[i][j], end = "")
        print()
        
main()

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

ans = ""
for _ in range(H):
    s = input()
    ans += s + '\n'
    ans += s + '\n'

print(ans, end='')

Solution (Python):
h,w = map(int,input().split())
c = [input()for _ in range(h)]
ans = []
for i in range(1,2*h+1):
    res = ''
    for j in range(1,w+1):
        res += c[(i+1)//2-1][j-1]
    ans.append(res)
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):

from sys import stdin
H, W = [int(x) for x in stdin.readline().rstrip().split()]

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

Solution (Python):
nums = [int(e) for e in input().split()]
c=[]
i=0
k=0
j=0
while(i<nums[0]):
    row = input()
    c.append(row)
    i+=1

while(k<nums[0]):
    j=0
    while(j<2):
        print(c[k],'\n')
        j+=1
    k+=1

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

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

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

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

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    H, W = map(int, input().split())
    C = [None] * H
    for i in range(H):
        C[i] = input().rstrip()

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


if __name__ == "__main__":
    main()

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

Solution (Python):
h,w = map(int,input().split())
gecko = []
x = 0
y = 0
for x in range(h):
    inputa = input()
    gecko.append(inputa)
    x += 1
for y in range(h):
    print(gecko[y])
    print(gecko[y])
    y += 1

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

for _ in range(H):
    ci = input().split()
    print("".join(ci))
    print("".join(ci))

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):
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(h):
    a = input().replace('\n', '')
    print(a+"\n"+a)

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

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

Solution (Python):
from sys import stdin

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

c = [stdin.readline().rstrip() for _ in range(h)]
for ci in c:
    print(ci)
    print(ci)

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

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

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

Solution (Python):
for i in open(0).read().split()[2:]:print(i + "\n" + i)

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

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

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

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

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

i = 0
while i < H:
    print(s[i])
    print(s[i])
    i += 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())
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())
for i in range(h):
    c = input()
    print(c)
    print(c)

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

pixels = [input().split() for i in range(H)]

output_pixels = []

for row in pixels:
    for i in range(2):
        output_pixels.append(row)
    
for row in output_pixels:
    print(''.join(row))

Solution (Python):



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


in1 = []
for idx1 in range(h):
    in1.append(input())


for item1 in in1:
    print(item1)
    print(item1)

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

Solution (Python):

import math
import itertools
import statistics

import collections


h, w = list(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_L = []
for i in range(h):
    c = list(map(str,input().split()))
    
    c_L.append(c)
    c_L.append(c)

for s in c_L:
    print("".join(s))

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    h,w=MI()
    cc=[SI() for _ in range(h)]
    dd=[""]*h*2
    for i in range(h):
        dd[i*2]=dd[i*2+1]=cc[i]
    p2D(dd)

main()

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

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

Solution (Python):




import sys
input = sys.stdin.readline



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

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



main()

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

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

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

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

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())
    print(c[-1])
    print(c[-1])

Solution (Python):




"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""






def main():
  h,w = map(int,input().split())
  for _ in range(h):
    s = input()
    print(s)
    print(s)
if __name__ == '__main__':
  main()

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

Solution (Python):
import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
INF = 1 << 60
sys.setrecursionlimit(10 ** 6)


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

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

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

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

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

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


if __name__ == '__main__':
    b, c = map(int, input().split())

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

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

for i in range(h):
    for _ in range(2):
        print("".join(c[i]))

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

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

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

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

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

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

for i in range(H * 2):
    Ca = ""
    for j in range(W):
        Ca += C[(((i+1)+1)//2)-1][j]
    print(Ca)

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):
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())
list = []
while True:
	try:
		list.append(input())
	except:
		break
for v in list:
	print(v)
	print(v)

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

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

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

Solution (Python):
import sys
from math import sqrt
from collections import Counter

input = sys.stdin.readline


def I():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return list(MI())


def LIN(n: int):
    return [I() for _ in range(n)]


inf = float("inf")
mod = 10 ** 9 + 7


def main():
    h, w = MI()
    c = [input().split() for _ in range(h)]

    for line in c:
        print(line[0])
        print(line[0])

    pass


if __name__ == "__main__":
    main()

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

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

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

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

str_list = [input() for i in range(h)]

for s in str_list:
    for j in range(2):
        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())
S=[input() for _ in range(H)]

for s in S:
    print(s)
    print(s)

Solution (Python):

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

Solution (Python):
import bisect,collections,copy,itertools,math,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())

H,W = LI()
C = [LS() for _ in range(H)]
for x in C:
    print(*x)
    print(*x)

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

Solution (Python):
import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    
    
    
    h,w=list(map(int, readline().strip().split()))
    for _ in range(h):
        s=readline().strip()
        print(s)
        print(s)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

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

for i in range(H):
  p = input()
  img.append(p)

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

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

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 k in range(H)]
for e in C:
    print(e)
    print(e)

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

for i in range(h):
    ans = T[i]
    print("".join(ans))
    print("".join(ans))

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

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    H,W=MI()
    for i in range(H):
        S=input()
        for _ in range(2):
            print(S)
        

main()

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

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

for item in ans:
    print(item)

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

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

Solution (Python):








def resolve():

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

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

resolve()

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())
for _ in [0]*h:
  c=input()
  print(c)
  print(c)

Solution (Python):

def main(N):
    for i in range(N):
        print(''.join(L[i]))
        print(''.join(L[i]))

H,W = map(int, input().split())
L = [input().split() for l in range(H)]
main(H)

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=["0" for k in range(H)]
for k in range(H):
    C[k]=input()
D=["0"for k in range(2*H)]
for k in range(H):
    D[2*k]=C[k]
    D[2*k+1]=C[k]
for k in range(2*H):
    print(D[k])

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

for item in ans:
    print(item)

Solution (Python):

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

for i in range(H):
    print(''.join(L[i]))
    print(''.join(L[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,input().split())
S=[input()for i in range(H)]
for i in range(H):
    print(S[i])
    print(S[i])

Solution (Python):
h, w = list(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() for i in range(h)]
a = []
for l in c:
  a.append(l)
  a.append(l)
print("\n".join(a))

Solution (Python):
h, w = map(int, input().split())
c = [list(input().split()) for i 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):
	array = input().strip()
	c.append(array)
ans = []
for i in c:
  ans.append(i)
  ans.append(i)
print(*ans,sep = '\n')

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