#include <bits/stdc++.h>
using namespace std;
using VP = vector<pair<long long, long long> >;
using VVP = vector<VP>;
using VI = vector<long long>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
int main() {
  long long i, j;
  long long n;
  cin >> n;
  long long fib[60];
  fib[0] = 1;
  fib[1] = 2;
  for (i = 2; i < 60; i++) fib[i] = fib[i - 1] + fib[i - 2];
  long long ans[n][n];
  for (i = 0; i < n; i++) ans[i][i] = 0;
  long long p = 0;
  for (i = 1; i <= n / 2; i++) {
    if (i != 1) {
      for (j = 0; j < n; j++) {
        {
          ans[(i + j) % n][j] = fib[p];
          ans[j][(i + j) % n] = fib[p];
          p++;
        }
      }
    } else {
      for (j = 0; j < n; j++) {
        if (j % 2 == 0) {
          ans[(i + j) % n][j] = fib[p];
          ans[j][(i + j) % n] = fib[p];
          p++;
        }
      }
      for (j = 0; j < n; j++) {
        if (j % 2 == 1) {
          ans[(i + j) % n][j] = fib[p];
          ans[j][(i + j) % n] = fib[p];
          p++;
        }
      }
    }
    p++;
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cout << ans[i][j];
      if (j != n - 1) cout << " ";
    }
    cout << endl;
  }
  return 0;
}
