#include <bits/stdc++.h>
using namespace std;
void desperate_optimization(int precision) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios::fixed);
  cout.setf(ios::showpoint);
  cout.precision(precision);
}
const int N = 10;
long long arr[N + 5][N + 5];
set<int> st;
set<int> nx;
vector<int> vec;
set<int>::iterator it;
void iterate(set<int>::iterator x, int total) {
  if (x == st.end()) return;
  int wow = (*x);
  nx.insert(total), nx.insert(total + wow);
  set<int>::iterator nxw = x;
  nxw++;
  iterate(nxw, total);
  iterate(nxw, total + wow);
}
void hora(int tc) {
  int n;
  cin >> n;
  int pre = 1, po = 2;
  st.insert(pre);
  st.insert(po);
  for (int i = 3; i <= n; i++) {
    st.insert(pre + po);
    int w = pre + po;
    pre = po;
    po = w;
  }
  long long maxi = 0;
  vec.push_back(0);
  for (int i = 1; i < n; i++) {
    int j = 0;
    for (auto x : st) {
      if (i == j) break;
      arr[i][j] = arr[j][i] = (maxi + 1) * x;
      j++;
    }
    vec.push_back(i);
    sort(vec.begin(), vec.end());
    do {
      long long tots = 0;
      for (int i = 1; i < vec.size(); i++) tots += arr[vec[i - 1]][vec[i]];
      maxi = max(maxi, tots);
    } while (next_permutation(vec.begin(), vec.end()));
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j) cout << " ";
      cout << arr[i][j];
    }
    cout << '\n';
  }
}
int main() {
  desperate_optimization(10);
  int ntc = 1;
  for (int tc = 1; tc <= ntc; tc++) hora(tc);
  return 0;
}
