#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y) {
  if (y == 0) return 1;
  if (y == 1) return x;
  long long r = power(x, y / 2);
  if (y % 2 == 0)
    return r * r;
  else
    return r * r * x;
}
long long convertBinaryToDecimal(long long num) {
  long long rem, temp = num, dec = 0, b = 1;
  while (num > 0) {
    rem = temp % 10;
    dec = dec + rem * b;
    b *= 2;
    temp /= 10;
  }
  return dec;
}
int main() {
  int n, x;
  cin >> n >> x;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j == i)
        cout << x << " ";
      else
        cout << "0"
             << " ";
    }
    cout << endl;
  }
  return 0;
}
