#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int a[25];
bool mark[N];
int main() {
  int n;
  cin >> n;
  a[1] = 1;
  mark[1] = true;
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j <= 1000; j++) {
      if (!mark[j]) {
        bool markk = false;
        for (int k = i - 1; k > 0; k--) {
          if (mark[j + a[k]]) {
            markk = true;
          }
        }
        if (!markk) {
          a[i] = j;
          for (int k = i - 1; k > 0; k--) {
            mark[j + a[k]] = true;
          }
          mark[j] = true;
          break;
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i != j) {
        cout << a[i] + a[j] << " ";
      } else
        cout << 0 << " ";
    }
    cout << endl;
  }
}
