#include <bits/stdc++.h>
using namespace std;
void timer() { return; }
const int mod = 1e9 + 7;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
string ds = "RLDU";
const int mx = 5e4 + 10;
long long sum[mx];
void solve() {
  int n, t;
  cin >> n >> t;
  for (int i = (1); i < (n + 1); ++i) {
    for (int j = (0); j < (n - i); ++j) {
      cout << 0 << " ";
    }
    cout << t << " ";
    for (int j = (n - i + 1); j < (n); ++j) cout << 0 << " ";
    cout << endl;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  timer();
  int t = 1;
  for (int i = (1); i < (t + 1); ++i) {
    solve();
  }
  timer();
}
