#include <bits/stdc++.h>
using namespace std;
template <typename T, typename V>
ostream &operator<<(ostream &os, const pair<T, V> pai) {
  return os << '(' << pai.first << ' ' << pai.second << ')';
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> v) {
  cout << "[";
  for (int i = 0, _i = (((int)(v).size())); i < _i; i++) cout << v[i] << ",";
  cout << "]";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> v) {
  cout << "{";
  for (auto p : v) cout << p << ",";
  cout << "}";
  return os;
}
template <typename T, typename V>
ostream &operator<<(ostream &os, const map<T, V> v) {
  cout << "{";
  for (auto p : v) cout << p << ",";
  cout << "}";
  return os;
}
template <typename T>
void get_max(T &a, T b) {
  a = max(a, b);
}
template <typename T>
void get_min(T &a, T b) {
  a = min(a, b);
}
int N, H, D;
long long dist[10][10];
bool test() {
  int seq[10];
  iota(seq, seq + 10, 0);
  set<int> d;
  do {
    if (seq[2] > seq[1]) continue;
    long long csum = 0;
    for (int i = 0, _i = (N - 1); i < _i; i++) csum += dist[seq[i]][seq[i + 1]];
    if (not d.insert(csum).second) return false;
  } while (next_permutation(seq + 1, seq + N));
  return true;
}
int main(void) {
  iostream::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  srand(time(nullptr));
  cin >> N;
  do {
    for (int i = 0, _i = (N); i < _i; i++)
      for (int j = (i + 1), _j = (N); j < _j; j++) {
        dist[i][j] = dist[j][i] =
            abs(((((long long)rand()) * 162378123) ^ rand()) % 99999999999 + 1);
      }
  } while (not test());
  for (int i = 0, _i = (N); i < _i; i++)
    for (int j = 0, _j = (N); j < _j; j++)
      cout << dist[i][j] << (j == N - 1 ? '\n' : ' ');
}
