#include const int NMAX = 1000; using namespace std; int N,M; int photo[NMAX][NMAX]; int X; int main() { cin >> N >> M >> X; for (int i = 0; i < N; ++i) { for (int j = 0; j < M; ++j) { cin >> photo[i][j]; } } for (int i = 0; i < N*X; ++i) { for (int j = 0; j < M*X; ++j) { cout << photo[i/X][j/X] << " "; } cout << '\n'; } return 0; }