#include <bits/stdc++.h>
using namespace std;
void base() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  base();
  int n, num;
  cin >> n >> num;
  int turn = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (turn == j) {
        cout << num << " ";
      } else {
        cout << 0 << " ";
      }
    }
    cout << endl;
    turn++;
  }
  return 0;
}
