#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e17;
const long long MOD = 1000000007;
const long long MAX = 4000001;
const long double eps = 1E-14;
long long max(long long a, long long b) {
  if (a > b) {
    return a;
  }
  return b;
}
long long min(long long a, long long b) {
  if (a > b) {
    return b;
  }
  return a;
}
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  if (a < b) {
    return gcd(b, a);
  }
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
struct edge {
  long long ind;
  long long fr;
  long long to;
  long long d;
};
class mint {
  long long x;

 public:
  mint(long long x = 0) : x((x % MOD + MOD) % MOD) {}
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint& a) {
    if ((x += a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator-=(const mint& a) {
    if ((x += MOD - a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator*=(const mint& a) {
    (x *= a.x) %= MOD;
    return *this;
  }
  mint operator+(const mint& a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint& a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint& a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(long long t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }
  mint inv() const { return pow(MOD - 2); }
  mint& operator/=(const mint& a) { return (*this) *= a.inv(); }
  mint operator/(const mint& a) const {
    mint res(*this);
    return res /= a;
  }
  friend ostream& operator<<(ostream& os, const mint& m) {
    os << m.x;
    return os;
  }
};
mint pw(mint a, long long b) {
  if (b == 0) {
    return 1;
  }
  mint ret = pw(a, b >> 1);
  ret *= ret;
  if (b & 1) {
    ret *= a;
  }
  return ret;
}
int main() {
  long long N;
  cin >> N;
  vector<long long> l = {0, 1, 2, 4, 7, 12, 20, 33, 54, 88};
  vector<vector<long long>> g(N + 1, vector<long long>(N + 1, 0));
  long long mx = 2;
  g[1][2] = 1;
  for (long long i = 3; i <= N; i++) {
    for (long long j = 1; j <= i - 1; j++) {
      g[i][j] = mx * l[j];
    }
    mx = mx + g[i][i - 1] + g[i][i - 2] + 1;
  }
  for (long long i = 1; i <= N; i++) {
    for (long long j = 1; j <= N; j++) {
      if (i >= j) {
        cout << g[i][j] << " ";
      } else {
        cout << g[j][i] << " ";
      }
    }
    cout << endl;
  }
}
