#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  long long ans[11][11];
  if (n <= 9) {
    memset(ans, 0, sizeof(ans));
    long long now = 1;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (j <= i) {
          ans[i][j] = ans[j][i];
        } else {
          ans[i][j] = now;
          now <<= 1;
        }
      }
    }
  } else {
    memset(ans, 0, sizeof(ans));
    long long now = 1;
    for (int i = 0; i < 9; i++) {
      for (int j = 0; j < 9; j++) {
        if (j <= i) {
          ans[i][j] = ans[j][i];
        } else {
          ans[i][j] = now;
          now <<= 1;
        }
      }
    }
    for (int i = 0; i < 9; i++) {
      ans[i][9] = ans[9][i] = 1 + (1ll << (i * 2 + 2)) + (1ll << (i * 2 + 3));
    }
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      printf("%lld", ans[i][j]);
      printf("%c", " \n"[j == n - 1]);
    }
  return 0;
}
