'use strict'

const main = (input) => {
    input = input.split('\n')
    const h = parseInt(input[0].split(' ')[0])
    const arr = input.slice(1, h + 1)
    const arrC = arr.slice()

    for(let i = 0; i < arr.length; i++){
        console.log(arr[i])
        console.log(arrC[i])
    }
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))