fun main(args: Array<String>) {
    abc049b()
}

fun abc049b() {
    val (h, w) = readLine()!!.split(" ").map { it.toInt() }
    val cList = (1..h).map { readLine()!! }

    val answer = cList.map { c -> (1..2).map { c } }.flatten().joinToString(System.lineSeparator())

    println(answer)
}
