fun main(args: Array<String>) {
    val hw = readLine()!!.split(' ').map { it.toInt() }
    val height = hw[0]
    var computed: MutableList<List<Char>> = mutableListOf()

    for(i in 1..height) {
        val line = readLine()!!.toMutableList()
        computed.add(line)
        computed.add(line)
    }

    computed.forEach {
        println(it.joinToString(separator = ""))
    }

}