#include using namespace std; int n, m, x; int mat[105][105]; int main() { int n, m, x; cin >> n >> m >> x; for (int i = 0; i < n; ++ i) for (int j = 0; j < m; ++ j) cin >> mat[i][j]; for (int i = 0; i < n * x; ++ i) for (int j = 0; j < m * x; ++ j) cout << mat[i / x][j / x] << " \n"[j + 1 == m * x]; return 0; }