#include <iostream>
#include <fstream>
#include <string.h>
#include <iomanip>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <stdlib.h>
#include <stdio.h>
#define SIZE 105

using namespace std;

/* Name are to be changed before sending code/ */

ifstream f("date.in");
ofstream g("date.out");

int     n, m, x;

void    prel_1(void)
{
    int     a[SIZE][SIZE];

    cin >> n >> m >> x;
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= m; j++)
            cin >> a[i][j];
    }
    for (int i = 1; i <= n; i++)
    {
        for (int row = 1; row <= x; row++)
        {
            for (int j = 1; j <= m; j++)
            {
                for (int col = 1; col <= x; col++)
                    cout << a[i][j] << ' ';
            }
            cout << '\n';
        }
    }
}
int main()
{
    prel_1();
    return 0;
}