#include<bits/stdc++.h>
int main(){
    int n,b,i,j;
    while(scanf("%d %d",&n,&b)!=EOF){
        char a[105][105];
        for(i=0;i<n;i++)
            scanf("%s",&a[i]);
        for(i=0;i<n;i++){
            printf("%s\n",a[i]);
            printf("%s\n",a[i]);
    }
}
    return 0;
}
