#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  int n, h;
  cin >> n >> h;
  bool flag;
  for (int k = 0; k < n; k++) {
    flag = false;
    for (int j = 0; j < n; j++) {
      if (flag) cout << " ";
      flag = true;
      if (j == k)
        cout << h;
      else
        cout << "0";
    }
    cout << endl;
  }
  return 0;
}
