#include using namespace std; int a[126][126]; int v[126][126]; int main() { int n, m, x; int o = 1, p = 1; cin>>n>>m>>x; for(int i = 1 ; i <= n ; ++i) for(int j = 1 ; j <= m ; ++j) cin>>v[i][j]; for(int i = 1 ; i <= 126 ; ++i) for(int j = 1 ; j <= 126 ; ++j) a[i][j] = -1; for(int i = 1 ; i <= n * x + x; i += x){ for(int j = 1 ; j <= m * x + x; j += x){ for(int q = i ; q <= i + x ; ++q) for(int w = j ; w <= j + x ; ++w) a[q][w] = v[o][p]; ++p; } p = 1; ++o; } for(int i = 1 ; i <= n * x ; ++i){ for(int j = 1 ; j <= m * x ; ++j) cout<