#include <iostream>
#define L_MAX 10000
using namespace std;
int v[L_MAX][L_MAX];
int main()
{
    int n, m, x, i, y, z, t;
    cin>>n>>m>>x;
    for(i=1; i<=n; i++)
        for(y=1; y<=m; y++)
        cin>>v[i][y];
    for(i=1; i<=n; i++)
        for(t=1; t<=x; t++)
    {
        for(y=1; y<=m; y++)
            for(z=1;z<=x; z++)
            cout<<v[i][y]<<" ";
        cout<<"\n";
    }
    return 0;
}