#include <bits/stdc++.h>
using namespace std;
int a[100000];
int p[100000];
int main() {
  int n, l;
  cin >> n >> l;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i == j)
        cout << l - n + 1 << " ";
      else
        cout << 1 << " ";
    }
    cout << endl;
  }
  return 0;
}
