#include <bits/stdc++.h>
using namespace std;
template <typename T>
void chmin(T &a, T b) {
  if (a > b) a = b;
}
template <typename T>
void chmax(T &a, T b) {
  if (a < b) a = b;
}
int in() {
  int x;
  scanf("%d", &x);
  return x;
}
long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
bool check(vector<vector<long long> > d) {
  int n = d.size();
  vector<int> p(n);
  for (int i = 0; i < n; ++i) p[i] = i;
  map<long long, int> mp;
  int t = 0;
  do {
    long long s = 0;
    int mask = (1 << p[0]);
    for (int i = 0; i < n - 1; ++i) {
      s += d[p[i]][p[i + 1]];
    }
    mp[s]++;
    if (mp[s] > 2) {
      return false;
    }
  } while (next_permutation((p).begin(), (p).end()));
  return true;
}
const long long ma = 1e10;
int main() {
  int n;
  cin >> n;
  vector<vector<long long> > d(n, vector<long long>(n));
  srand(13230);
  int cnt = 0;
  while (true) {
    cnt++;
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j) {
        if (j > i)
          d[i][j] = (rand() % ma) + 1;
        else
          d[i][j] = d[j][i];
      }
    if (check(d)) break;
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) cout << d[i][j] << " ";
    cout << endl;
  }
  return 0;
}
