#include <iostream>
#include <cstring>

using namespace std;

int arr[1001][1001];

int main () {
    int m, n, p;

    cin >> m >> n >> p;



    for (int i = 0; i < n; i ++) {
        for (int j = 0; j < n; j ++) {
            if (i == n - 1 or j == n - 1) {
                arr[i][j] = arr[i][j - 1] + 1;
            }else {
                arr[i][j] = arr[i - 1][j] + 1;
            }
        }
    }

    int s = 0;

    for (int i = 0; i < n; i ++) {
        for (int j = 0; j < n; j ++) {
            /*s += arr[p - 1][j];*/
            cout << arr[i][j] << " ";
        }
        cout << endl;
    }


}
