#include <bits/stdc++.h>
using namespace std;
int main(void){
    int h,w;
    cin>>h>>w;
    string s;
    for (int i=0;i<h;i++) {
        cin>>s;
        cout<<s<<endl;
        cout<<s<<endl;
    }
}
