#include <bits/stdc++.h>
using namespace std;
int main() {
  int cells, steps;
  cin >> cells >> steps;
  int memory[cells];
  for (int i = 0; i < cells - 1; i++) {
    memory[i] = 1;
  }
  memory[cells - 1] = 0;
  int max_increment = 1;
  for (int i = 0; i < steps; i++) {
    for (int j = 0; j < cells; j++) {
      if (j == cells - 1) {
        cout << cells;
        continue;
      } else if (j == cells - 2) {
        cout << cells << " ";
        continue;
      }
      int correct = cells - j - 1;
      if (memory[j] == correct) {
        cout << cells << " ";
      } else {
        if (memory[j] + max_increment >= correct) {
          int diff = correct - memory[j];
          cout << cells - diff << " ";
          memory[j] += diff;
        } else {
          cout << cells - max_increment << " ";
          memory[j] += max_increment;
        }
      }
    }
    cout << endl;
    max_increment *= 2;
  }
  return 0;
}
