#include <bits/stdc++.h>
using namespace std;
long long ans[11][11];
bool check() {
  int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  vector<long long> v;
  do {
    if (a[0] > a[9]) continue;
    long long sum = 0;
    for (int i = 1; i < 10; i++) sum += ans[a[i - 1]][a[i]];
    v.push_back(sum);
  } while (next_permutation(a, a + 10));
  sort(v.begin(), v.end());
  long long last = 0;
  for (auto it : v) {
    if (it == last) return false;
  }
  return true;
}
int main() {
  int n;
  scanf("%d", &n);
  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;
        }
      }
    }
    long long mod = 1e10;
    do {
      for (int i = 0; i < 9; i++) {
        ans[i][9] = ans[9][i] = ((((long long)rand()) << 20) + rand()) % mod;
      }
    } while (!check());
  }
  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;
}
