#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using ll = long long int;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vd = vector<double>;
using vvd = vector<vd>;
using vvvd = vector<vvd>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using cdouble = complex<double>;
const double eps = 1e-7;
bool feq(double x, double y) { return abs(x - y) <= eps; }
bool inrange(ll x, ll t) { return x >= 0 && x < t; }
bool inrange(vll xs, ll t) {
  for (auto x : xs)
    if (!(x >= 0 && x < t)) return false;
  return true;
}
int ceillog2(ll x) {
  int ret = 0;
  x--;
  while (x > 0) {
    ret++;
    x >>= 1;
  }
  return ret;
}
ll rndf(double x) { return (ll)(x + (x >= 0 ? 0.5 : -0.5)); }
ll floorsqrt(ll x) {
  ll m = (ll)sqrt((double)x);
  return m + (m * m <= x ? 0 : -1);
}
ll ceilsqrt(ll x) {
  ll m = (ll)sqrt((double)x);
  return m + (x <= m * m ? 0 : 1);
}
ll rnddiv(ll a, ll b) { return (a / b + (a % b * 2 >= b ? 1 : 0)); }
ll ceildiv(ll a, ll b) { return (a / b + (a % b == 0 ? 0 : 1)); }
ll gcd(ll m, ll n) {
  if (n == 0)
    return m;
  else
    return gcd(n, m % n);
}
ll lcm(ll m, ll n) { return m * n / gcd(m, n); }
int main() {
  int n;
  cin >> n;
  vll a = {1};
  ll last = 2;
  vvll ans(n, vll(n));
  ans[0][1] = 1;
  ans[1][0] = 1;
  for (int i = 3; i <= n; i++) {
    ll x = 0, y = 0;
    for (int j = 0; j < int(i - 2); j++) {
      x += a[j];
      y += a[a.size() - 1 - j];
    }
    ll d = y - x + 1;
    ll r = d;
    for (int j = 0; j < int(i - 1); j++) {
      ans[i - 1][j] = last;
      ans[j][i - 1] = last;
      a.push_back(last);
      last += r;
      r += d;
    }
  }
  for (int ex_i = 0; ex_i < int(ans.size()); ex_i++) {
    for (int ex_j = 0; ex_j < int(ans[ex_i].size()); ex_j++) {
      cout << ans[ex_i][ex_j] << " ";
    }
    cout << endl;
  };
}
