#include <bits/stdc++.h>
using namespace std;
vector<long long> fib;
vector<vector<long long>> dfs(long long n) {
  if (n == 1) {
    return vector<vector<long long>>(1, vector<long long>(1, 0));
  }
  vector<vector<long long>> pre = dfs(n - 1);
  vector<vector<long long>> res(n, vector<long long>(n, 0));
  vector<long long> vs;
  for (long long i = (long long)(0); i < (long long)(n - 1); i++)
    for (long long j = (long long)(0); j < (long long)(n - 1); j++)
      res[i][j] = pre[i][j];
  for (long long i = (long long)(0); i < (long long)(n - 1); i++)
    vs.push_back(i);
  long long mx = -1;
  do {
    long long sum = 0;
    for (long long i = (long long)(0); i < (long long)(n - 2); i++) {
      sum += res[vs[i]][vs[i + 1]];
    }
    mx = (mx > sum ? mx : sum);
  } while (next_permutation((vs).begin(), (vs).end()));
  mx++;
  for (long long i = (long long)(0); i < (long long)(n - 1); i++) {
    res[i][n - 1] = res[n - 1][i] = fib[i] * mx;
  }
  return res;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  fib.resize(10);
  fib[0] = 1;
  fib[1] = 2;
  for (long long i = (long long)(2); i < (long long)(10); i++)
    fib[i] = fib[i - 1] + fib[i - 2] + 1;
  long long N;
  cin >> N;
  vector<vector<long long>> res = dfs(N);
  for (long long i = (long long)(0); i < (long long)(N); i++) {
    for (long long j = (long long)(0); j < (long long)(N); j++) {
      cout << res[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
