import scala.io.StdIn._
object Main extends App{
  val sc = new java.util.Scanner(System.in)
  var h,w = sc.nextInt
  val list = List.fill(h)(sc.next)
  for(x <-list){
    println(x)
    println(x)
  }
}