#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e3 + 3;
int m[MAX][MAX];
int N, K, D;
int main(int argc, char** argv) {
  scanf("%d%d%d", &N, &K, &D);
  for (int i = (1); i <= (D); i++) m[1][i] = 1;
  for (int i = (2); i <= (N); i++) {
    for (int j = (D); j >= (1); j--) {
      m[i][j] += m[i - 1][j];
      if (j == D) m[i][j]++;
      if (m[i][j] > K) m[i][j] = 1, m[i][j - 1]++;
      if (m[i][0]) {
        puts("-1");
        exit(0);
      }
    }
  }
  for (int j = (1); j <= (D); j++) {
    for (int i = (1); i <= (N); i++) printf("%d ", m[i][j]);
    printf("\n");
  }
  return 0;
}
