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