import Foundation

var target: [String] = []

func main() {
	let inputRow = readLine()!.split(separator: " ").map { Int($0)! }
	for i in 0..<inputRow.first! {
		let str = readLine()!
      	print(str)
        print(str)
	}
}

main()