import java.util.*

fun main(args: Array<String>) {
	val sc = Scanner(System.`in`)
	val h = sc.nextInt()
	val w = sc.nextInt()

	val ans = mutableListOf<String>()

	for (i in 0 until h) {
		val c = sc.next()
		for (j in 0 until 2) {
			ans.add(c)
		}
	}
	println(ans.joinToString("\n"))
}
