#include <bits/stdc++.h>
using namespace std;
int st, bus, tr;
int num[1100][1100];
int main() {
  cin >> st >> bus >> tr;
  if (bus <= 1000) {
    if (st > pow(bus, tr)) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int j = 1; j < st; j++) {
    num[j][0] = 1;
    for (int i = 0; i < tr; i++) {
      num[j][i] += num[j - 1][i];
      num[j][i + 1] += num[j][i] / bus;
      num[j][i] %= bus;
    }
  }
  for (int i = 0; i < tr; i++) {
    for (int j = 0; j < st; j++) {
      cout << num[j][i] + 1 << " ";
    }
    cout << endl;
  }
  return 0;
}
