#include <bits/stdc++.h>
using namespace std;
int i, j, c, n, k;
int main() {
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (j == c) {
        cout << k << " ";
      } else {
        cout << 0 << " ";
      }
    }
    cout << endl;
    c++;
  }
}
