AtCoder Beginner Contest 049 - Thin

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-----
2 2
*.
.*

-----Sample Output-----
*.
*.
.*
.*

Difficulty: EASY

Starter code:

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


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


(h, w) = map(int, input().split())
c = [list(input()) for i in range(h)]
for i in c:
	for j in i:
		print(j, end='')
	print('')
	for j in i:
		print(j, end='')
	print('')


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


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


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


(x, y) = map(int, input().split())
for _ in range(x):
	N = list(input())
	for _ in range(2):
		print(''.join(N))


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


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


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


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


num = input().split()
hei = int(num[0])
wei = int(num[1])
photo = []
for i in range(hei):
	temp = input()
	temp = list(temp)
	photo.append(temp)
	photo.append(temp)
for i in range(hei * 2):
	for j in range(wei):
		print(photo[i][j], end='')
	print('\n', end='')


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


(H, W) = map(int, input().split())
for _ in range(H):
	c = input()
	print(c, c, sep='\n')


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


(H, W) = map(int, input().split())
for i in range(H):
	C = input()
	print(C, C, sep='\n')


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


h = int(input().split()[0])
for i in range(h):
	line = input()
	print(line)
	print(line)


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


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


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


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


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


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


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


(h, w) = map(int, input().split())
for _ in [0] * h:
	c = input()
	print(c)
	print(c)


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


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


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


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


(a, b) = (int(_) for _ in input().split())
for i in range(a):
	x = input()
	print(x)
	print(x)


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


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


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


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


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


(H, W) = [int(a) for a in input().split()]
lst = []
for i in range(H):
	lst.append(input())
for i in range(H):
	print(lst[i])
	print(lst[i])


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


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


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


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


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


for i in range(int(input().split()[0])):
	a = input()
	print(a, a, sep='\n')


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


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


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


(h, w) = map(int, input().split())
pixel = [input() for _ in range(h)]
for i in pixel:
	for j in range(2):
		print(i)


from typing import List

def answer(h: int, w: int, c: List[str]) -> str:
	result = ''
	for i in c:
		for j in range(2):
			result += f'{i}\n'
	return result[:-1]

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

def __starting_point():
	main()
__starting_point()


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


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


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


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


(H, W) = [int(n) for n in input().split()]
for h in range(H):
	C = input()
	print(C + '\n' + C)


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


(H, W, *C) = open(0).read().split()
for c in C:
	print(c)
	print(c)


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


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


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


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


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


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


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


(H, W) = map(int, input().split())
grid = []
for i in range(H):
	array = list(input().strip().split())
	grid.append(array)
for i in range(H):
	print(''.join(grid[i]))
	print(''.join(grid[i]))


import sys
input = sys.stdin.readline
import numpy as np

def main():
	dot = []
	(h, w) = map(int, input().split())
	dot = np.array([list(input().rstrip()) for _ in range(h)])
	for i in range(1, h + 1):
		print(''.join(dot[i - 1]))
		print(''.join(dot[int(i + 1 / 2) - 1]))

def __starting_point():
	main()
__starting_point()


(_, *t) = open(0)
for i in t:
	print(i + i)


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


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


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


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


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


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


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


(H, W) = (int(T) for T in input().split())
for TH in range(0, H):
	C = input()
	print(C + '\n' + C)


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


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


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


H = int(input().split(' ')[0])
for i in range(H):
	t = input()
	print(t)
	print(t)


(A, B) = map(int, input().split())
for i in range(A):
	n = input()
	print(n)
	print(n)


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


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


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


(n, m) = input().split()
l = ''
for i in range(int(n)):
	s = input()
	l += s + '\n' + s + '\n'
print(l)


(H, W) = map(int, input().split())
C = [input() for i in range(H)]
ans = ['' for i in range(H * 2)]
for i in range(H):
	for j in range(W):
		ans[2 * i] += C[i][j]
		ans[2 * i + 1] += C[i][j]
for i in range(2 * H):
	print(ans[i])


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


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


import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):

	def assertIO(self, input, output):
		(stdout, stdin) = (sys.stdout, sys.stdin)
		(sys.stdout, sys.stdin) = (StringIO(), StringIO(input))
		resolve()
		sys.stdout.seek(0)
		out = sys.stdout.read()[:-1]
		(sys.stdout, sys.stdin) = (stdout, stdin)
		self.assertEqual(out, output)

	def test_入力例_1(self):
		input = '2 2\n*.\n.*'
		output = '*.\n*.\n.*\n.*'
		self.assertIO(input, output)

	def test_入力例_2(self):
		input = '1 4\n***.'
		output = '***.\n***.'
		self.assertIO(input, output)

	def test_入力例_3(self):
		input = '9 20\n.....***....***.....\n....*...*..*...*....\n...*.....**.....*...\n...*.....*......*...\n....*.....*....*....\n.....**..*...**.....\n.......*..*.*.......\n........**.*........\n.........**.........'
		output = '.....***....***.....\n.....***....***.....\n....*...*..*...*....\n....*...*..*...*....\n...*.....**.....*...\n...*.....**.....*...\n...*.....*......*...\n...*.....*......*...\n....*.....*....*....\n....*.....*....*....\n.....**..*...**.....\n.....**..*...**.....\n.......*..*.*.......\n.......*..*.*.......\n........**.*........\n........**.*........\n.........**.........\n.........**.........'
		self.assertIO(input, output)

def resolve():
	(H, W) = list(map(int, input().split()))
	ans = []
	for i in range(H):
		S = input()
		ans.append(S)
		ans.append(S)
	for i in range(2 * H):
		print(ans[i])

def __starting_point():
	resolve()
__starting_point()


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


(N, M) = map(int, input().split())
for _ in range(N):
	x = input()
	print(x)
	print(x)


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


(H, W) = map(int, input().split())
for i in range(H):
	S = input()
	print(S + '\n' + S)


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


(h, w) = map(int, input().split())
c = [list(input()) for i in range(h)]
ac = [[0] * w for i in range(2 * h)]
for i in range(2 * h):
	for j in range(w):
		ac[i][j] = c[i // 2][j]
for s in ac:
	print(*s, sep='')


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


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


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

def __starting_point():
	main()
__starting_point()


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


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


import sys
input = sys.stdin.readline
sys.setrecursionlimit(200000)

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

def solve(H, W, C):
	for c in C:
		print(c)
		print(c)

def __starting_point():
	inputs = read()
	solve(*inputs)
__starting_point()


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


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


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


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


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


(h, w) = list(map(int, input().split()))
c = []
for i in range(h):
	c.append(input())
for i in range(h * 2):
	res = ''
	for j in range(w):
		res += c[i // 2][j]
	print(res)


from typing import List

def answer(h: int, w: int, c: List[str]) -> str:
	result = []
	for i in c:
		for _ in range(2):
			result.append(i)
	return '\n'.join(result)

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

def __starting_point():
	main()
__starting_point()


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


(h, w) = map(int, input().split())
c_lst = [list(map(str, input().split())) for _ in range(h)]
new_lst = []
for i in range(h):
	new_lst.append(c_lst[i])
	new_lst.append(c_lst[i])
for i in range(len(new_lst)):
	new = new_lst[i][0]
	print(new)


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


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


(height, width) = map(int, input().split())
for i in range(height):
	str = input()
	print(str)
	print(str)


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


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


url = 'https://atcoder.jp//contests/abc049/tasks/abc049_b'

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

def __starting_point():
	main()
__starting_point()


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


(H, W) = map(int, input().split())
C = [input() for _ in range(H)]
Wprint = lambda x: (print(x), print(x))
for c in C:
	Wprint(c)


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


for _ in range(int(input().split()[0])):
	c = input()
	print(c + '\n' + c)


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


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


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


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


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


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


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


import sys
input()
l = sys.stdin.read().split()
for line in l:
	print(line)
	print(line)


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


(x, y) = map(int, input().split())
L = []
for _ in range(x):
	N = list(input())
	L.append(N)
	L.append(N)
for l in L:
	print(''.join(l))


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


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


(H, W) = list(map(int, input().split()))
L = []
for _ in range(H):
	c = input()
	L.append(c)
	L.append(c)
for i in L:
	print(i)


(_, _, *C) = open(0).read().split()
for i in C:
	print(i)
	print(i)


(H, W) = map(int, input().split())
L = []
for i in range(H):
	C = list(map(str, input().split()))
	L.append(C)
	L.append(C)
for i in range(2 * H):
	print(L[i][0])


import sys, math
from itertools import combinations as c, product as p
from collections import deque
sys.setrecursionlimit(10 ** 9)

def si():
	return input()

def ii():
	return int(input())

def fi():
	return float(input())

def lstr():
	return input().split()

def lint():
	return list(map(int, input().split()))

def lint_dec():
	return list([int(x) - 1 for x in input().split()])

def lnstr(n):
	return [input() for _ in range(n)]

def lnint(n):
	return [int(input()) for _ in range(n)]

def lint_list(n):
	return [lint() for _ in range(n)]
(H, W) = lint()
image = lnstr(H)
for column in image:
	print(column)
	print(column)


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


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


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


h = int(input().split()[0])
for i in range(h):
	p = input()
	print(p + '\n' + p)


for _ in [0] * list(map(int, input().split()))[0]:
	s = input()
	print(s + '\n' + s)