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

for row in C:
    print(row)
    print(row)

Solution (Python):
h, w = map(int, input().split())
count = 0
prob_list = []
while count < h:
    prob_list.append(str(input()))
    prob_list.append(prob_list[-1])
    count += 1
for row in prob_list:
    print("".join(row))

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

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

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

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


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


if __name__ == '__main__':
    main()

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

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

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

pic = [[0 for i in range(w)] for j in range(h)]
pic2 = [[0 for i in range(w)] for j in range(2 * h)]

for i in range(h):
    pic[i] = input()
   
   
   




for i in range(2 * h):
    for j in range(w):
        pic2[i][j] = pic[i //2][j]
    

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

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

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

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

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

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

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

Solution (Python):
il = lambda: list(map(int, input().split()))
ils = lambda n, s="int(input())": [eval(s) for _ in range(n)]

h, w = il()
c = ils(h, "input()")
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):
h,w = map(int,input().split())

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

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

for i in range(h):
    temp = input()
    pic.append(temp)
    pic.append(temp)

for s in pic:
    print(s)

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

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

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

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

Solution (Python):
h,w=map(int,input().split())
a=[input() for i in range(h)]
x=1
while x<=h:
  print(a[x-1])
  print(a[x-1])
  x=x+1

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

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

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

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

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

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

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

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

for word in C:
    print(word)
    print(word)

Solution (Python):
s,w = map(int,input().split())
ans,temp = [],0
for i in range(s):
    temp = input()
    for l in range(2):
        ans.append(temp)
for n in range(len(ans)):
    print(ans[n])

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(1000000)



def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))



def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v



def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk



def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod // i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        return self.g1[n] * self.g2[r] * self.g2[n - r] % self.MOD




dp = None


def main():
    H, W = li_input()
    C = [input().split() for _ in range(H)]

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


main()

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

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

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

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

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

lis = []

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

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

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


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

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

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

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

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

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

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

Solution (Python):

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

Solution (Python):


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

    for i in graph:
        line = i
        print(''.join(line))
        print(''.join(line))

if __name__ == '__main__':
    main()

Solution (Python):

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


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

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

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

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

for i in a:
    for j in range(2):
        print(''.join(map(str, i)))

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

re = []

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

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

print("\n".join(["{0}\n{0}".format(line) for line in c]))

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

ans = [[0 for j in range(w)] for i in range(2 * h)]
for i in range(h):
    c = input()
    for j in range(len(c)):
        ans[i * 2][j] = c[j]
        ans[i * 2 + 1][j] = c[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())
for i in range(H):
    s = input()
    for j in range(2):
        print(s)

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

C=[]

for i in range(h):
    tmp=list(input())
    C.append(tmp)


for i in range(2*h):
    ans=["0"]*w
    for j in range(w):
        ans[j]=C[i//2][j]
    print(''.join(ans))

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

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

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

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

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

Solution (Python):
r, c = (int(x) for x in raw_input().split())
g = [raw_input() for _ in xrange(r)]
for i in xrange(2*r):
	print g[i/2]

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

d = [c[i//2] for i in range(h*2)]
for x in d:
    print(''.join(x))

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

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

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

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

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

for x in range(len(ans)):
    print(ans[x])

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

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

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

Solution (Python):


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

for i in range(H):
    print("".join(HW[i]))
    print("".join(HW[i]))

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

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

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

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

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

wordlist = []

for i in range(h):
  wordlist.append(list(input().split()))


output_string = []
for i in range(h):
  for j in range(2):
    output_string.append(wordlist[i])


for i in range(h * 2):
  print("".join(output_string[i]))

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

img = [raw_input() for _ in range(H)]

for i in img:
    print i
    print i

Solution (Python):
H,W=map(int,raw_input().split())
c = [raw_input() for r in range(H)]
for ci in c:
  print ci
  print ci

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

Solution (Python):
H, W = 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())
for _ in range(h):
  c = input()
  print(c)
  print(c)

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

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

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

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

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

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

if __name__ == "__main__":
    main()

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

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

array = [input() for x in range(h)]
for i in range(h):
    print(array[i])
    print(array[i])

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

Solution (Python):
import sys

lines = []
sys.stdin.readline()
for line in sys.stdin:
    line = line.strip()
    print(line)
    print(line)

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

Solution (Python):
h, w = map(int, input().split())
table = [[x for x in input()] for _ in range(h)]
ans_table = [[0 for _ in range(w)] for _ in range(2*h)]

for y in range(h):
  ans_y = 2 * y
  ans_table[ans_y] = table[y]
  ans_table[ans_y + 1] = table[y]

for y in range(2*h):
  print("".join(ans_table[y]))

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

for row in src:
    print(row)
    print(row)

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

a, b = [int(x) for x in stdin.readline().rstrip().split()]
data = [stdin.readline().rstrip().split() for _ in range(a)]

for i in range(a):
    str = data[i][0]
    print(str)
    print(str)

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

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 = 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 = [[0 for i in range(W)] for j in range(H)]
for i in range(H):
    C[i] = list(input().split())
CC = [[0 for i in range(W)] for j in range(2 * H)]
for i in range(H):
    CC[2 * i] = C[i]
    CC[2 * i + 1] = C[i]

for i in range(2 * H):
    print(''.join(CC[i]))

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

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

Solution (Python):
from collections import Counter


def getinputdata():
    
    array_result = []

    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if (data != ""):

                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result


arr_data = getinputdata()

h = int(arr_data[0][0])
w = int(arr_data[0][1])

for i in range(1, 1 + h):
    print(arr_data[i][0])
    print(arr_data[i][0])

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

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

for an in ans:
    print(an)

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

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

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

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

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

for i in range(h):
    fig_2.append(fig[i])
    fig_2.append(fig[i])
    
for i in range(len(fig_2)):
    onetime = ''
    for j in range(len(fig_2[i])):
        onetime = onetime + fig_2[i][j]
    print(onetime)

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

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

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

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

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

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

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

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

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

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

Solution (Python):





if __name__ == '__main__':
    height, width = list(map(int, input().split()))

    for i in range(height):
        line = input()
        print(line + '\n' + line)

Solution (Python):





if __name__ == '__main__':
    height, width = list(map(int, input().split()))

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

Solution (Python):
h, _ = list(map(int, input().split()))
pixels = [input() for i in range(h)]
for row in [pixels[j//2] for j in range(2*h)]:
    print(row)

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

Solution (Python):
H,W=map(int,input().split())
dotlist = [['' for x in range(W)] for y in range(2*H)]

for i in range(H):
  tmp = input()
  for j in range(W):
    dotlist[2*i][j] = tmp[j]
    dotlist[2*i+1][j] = tmp[j]
for n in range(2*H):
  tmp = ''
  for m in range(W):
    tmp += dotlist[n][m]
  print(tmp)

Solution (Python):
import pprint

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

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

for cc in C:
    print(cc)

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

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

Solution (Python):
h,w=map(int,input().split())
si=[]
for i in range(h):
  si.append(input())
for i in range(h):
  print(si[i])
  print(si[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, raw_input().split())
C=[raw_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)]
[[print(c[i]) for _ in range(2)] for i in range(h)]

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

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

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

Solution (Python):
H,W = [int(i) for i in input().split()]
ans = []
for i in range(H):
  c = input().strip()
  for j in range(2):
    ans.append(c)
print('\n'.join(ans))

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

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

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

solve()

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

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

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

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

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

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

if __name__ == '__main__':
    main()

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

for i in range(H):
    array.append(input())
for j in array:
    print(j)
    print(j)

Solution (Python):
h=int(input().split()[0])
c=[input() for _ in [0]*h]
for _c in c:
    print(_c)
    print(_c)

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

pic = [list(input()) for i in range(H)]

wide = pic

Ans = []

for i in range(H):
	Ans.append(pic[i])
	Ans.append(wide[i])

for i in Ans:
	print(''.join(i))

Solution (Python):
def main():
    H, W = map(int, input().split())
    C = [list(input()) for _ in range(H)]
    
    for x in range(H):
        for _ in range(2):
            for y in range(W):
                if y == W - 1:
                    print(C[x][y])
                else:
                    print(C[x][y], end = "")


if __name__ == "__main__":
    main()

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

for i in range(h):
  temp = input()
  li.append(temp)
  li.append(temp)

for i in li:
  print(i)

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

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

Solution (Python):


import sys
import os
import math
import itertools
import heapq
import numpy as np
from collections import OrderedDict, deque, Counter
from bisect import bisect_left, bisect_right, insort_left, insort_right
sys.setrecursionlimit(10000)

dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]


class Dijkstra():
    def dijkstra(self, adj, start, goal=None):
        '''
        ダイクストラアルゴリズムによる最短経路を求めるメソッド
        入力
        adj: adj[i][j]の値が頂点iから頂点jまでの距離(頂点iから頂点jに枝がない場合，値はfloat('inf'))となるような2次元リスト(正方行列)
        start: 始点のID
        goal: オプション引数．終点のID
        出力
        goalを引数に持つ場合，startからgoalまでの最短経路を格納したリストを返す
        持たない場合は，startから各頂点までの最短距離を格納したリストを返す
        d = Dijkstra()
        d.dijkstra([[float('inf'), 2, 4, float('inf'), float('inf')], [2, float('inf'), 3, 5, float('inf')], [4, 3, float('inf'), 1, 4], [float('inf'), 5, 1, float('inf'), 3], [float('inf'), float('inf'), 4, 3, float('inf')]], 0)
        [0, 2, 4, 5, 8] 
        d.dijkstra([[float('inf'), 2, 4, float('inf'), float('inf')], [2, float('inf'), 3, 5, float('inf')], [4, 3, float('inf'), 1, 4], [float('inf'), 5, 1, float('inf'), 3], [float('inf'), float('inf'), 4, 3, float('inf')]], 0, goal=4)
        [0, 2, 4] 
        '''
        num = len(adj)  
        dist = [float('inf') for i in range(num)]  
        prev = [float('inf') for i in range(num)]  

        dist[start] = 0
        q = []  
        heapq.heappush(q, (0, start))  

        while len(q) != 0:
            prov_cost, src = heapq.heappop(q)  

            
            if dist[src] < prov_cost:
                continue

            
            for dest in range(num):
                cost = adj[src][dest]
                if cost != float('inf') and dist[dest] > dist[src] + cost:
                    dist[dest] = dist[src] + cost  
                    heapq.heappush(q, (dist[dest], dest))  
                    prev[dest] = src  

        if goal is not None:
            return self.get_path(goal, prev)
        else:
            return dist

    def get_path(self, goal, prev):
        '''
        始点startから終点goalまでの最短経路を求める
        '''
        path = [goal]  
        dest = goal

        
        while prev[dest] != float('inf'):
            path.append(prev[dest])
            dest = prev[dest]

        
        return list(reversed(path))


class EndLoop(Exception):
    pass


def debug_print(L):
    for col in L:
        print(col)


def combination(n, k):  
    dp = [[0] * (n + 1) for i in range(n + 1)]
    for i in range(n + 1):
        dp[i][0] = 1
        dp[i][i] = 1
    for i in range(2, n + 1):
        for j in range(1, i):
            dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j]

    return dp[n][k]


def debug_print_joined(L):
    for col in L:
        print("".join(col))


def transpose_matrix(L):
    transposed = list(map(list, zip(*L)))
    return transposed


def solve():
    H, W = list(map(int, input().split(" ")))
    image_input = []
    for i in range(H):
        tmp = input()
        image_input.append(tmp)
    image_input.insert(0, "hoge")

    image_output = [[] for _ in range(H * 2 + 1)]
    for i in range(1, H * 2 + 1):
        for j in range(W):
            image_output[i].append(image_input[int(math.floor((i + 1) / 2))][j])

    for i in range(1, len(image_output)):
        print("".join(image_output[i]))

solve()

Solution (Python):

a = input().split()
n = int(a[0])
m = a[1]
s = "";
for i in range(0, n):
    tmp = input()
    if i != 0:
        s = s + "\n" + tmp + "\n" + tmp
    else:
        s = s + tmp + "\n" + tmp
print(s)