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