#include <bits/stdc++.h>
int table[110][110];
int n, k;
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    table[i][i] = k;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      printf("%d ", table[i][j]);
    }
    printf("\n");
  }
  return 0;
}
