object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val h = sc.nextInt
  sc.nextLine // 行末まで捨てる。
  (0 until h) foreach { _ =>
    val line = sc.nextLine
    println(line)
    println(line)
  }
}