#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &t) {
  os << "[";
  for (__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++) {
    if (it != t.begin()) os << ",";
    os << *it;
  }
  os << "]";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const set<T> &t) {
  os << "{";
  for (__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++) {
    if (it != t.begin()) os << ",";
    os << *it;
  }
  os << "}";
  return os;
}
template <class S, class T>
ostream &operator<<(ostream &os, const map<S, T> &t) {
  os << "{";
  for (__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++) {
    if (it != t.begin()) os << ",";
    os << *it;
  }
  os << "}";
  return os;
}
template <class S, class T>
ostream &operator<<(ostream &os, const pair<S, T> &t) {
  return os << "(" << t.first << "," << t.second << ")";
}
template <class S, class T>
pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first + t.first, s.second + t.second);
}
template <class S, class T>
pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first - t.first, s.second - t.second);
}
const int INF = 1 << 28;
const double EPS = 1e-8;
const int MOD = 1000000007;
int T, n, m;
int verify(vector<int> &v) {
  set<int> s;
  for (int i = 0; i < (int)(v.size()); i++) {
    for (int j = 0; j < (int)(i); j++) {
      if (s.count(v[i] + v[j])) return 0;
      s.insert(v[i] + v[j]);
    }
  }
  return 1;
}
int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  while (cin >> n) {
    vector<int> v(1, 1);
    for (int k = 0; k < (int)(9); k++) {
      int i = v.back() + 1;
      for (;; i++) {
        v.push_back(i);
        if (!verify(v)) {
          v.pop_back();
        } else {
          break;
        };
      }
    }
    long long int coef = v.back() + v[v.size() - 2];
    long long int c = 1;
    vector<vector<long long int>> g(n, vector<long long int>(n));
    long long int k = 0;
    for (int i = 0; i < (int)(n); i++) {
      for (int j = 0; j < (int)(i); j++) {
        g[i][j] = g[j][i] = c * v[j];
      }
      c *= v[max(i, 2) - 1] + v[max(i, 2) - 2];
    }
    for (int i = 0; i < (int)(n); i++) {
      for (int j = 0; j < (int)(n); j++) {
        cout << g[i][j] << " \n"[j + 1 == n];
      }
    }
  }
  return 0;
}
