#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, m;
  cin >> n >> m;
  for (long long j = n - 1; j >= 0; j--) {
    for (long long i = j; i > 0; i--) {
      cout << "0"
           << " ";
    }
    cout << m << " ";
    for (long long i = n - (j + 1); i > 0; i--) {
      cout << "0"
           << " ";
    }
    cout << '\n';
  }
}
