#include <bits/stdc++.h>
using namespace std;
const int M = 1000 + 5;
int ihash[M];
int main() {
  int N;
  cin >> N;
  int a[30];
  for (int i = 1; i <= 3; i++) {
    a[i] = i;
    ihash[i + 2] = 1;
  }
  for (int i = 4; i <= N; i++) {
    bool ok = false;
    for (int num = 1; num <= 1000 && ok == false; num++) {
      ok = true;
      for (int j = 1; j < i; j++) {
        if (ihash[a[j] + num] == 1) {
          ok = false;
          break;
        }
      }
      if (ok == true) {
        a[i] = num;
        for (int j = 1; j < i; j++) {
          ihash[a[j] + num] = 1;
        }
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) {
      if (i == j) {
        cout << "0";
      } else {
        cout << a[i] + a[j];
      }
      if (j < N) {
        cout << " ";
      } else {
        cout << endl;
      }
    }
  }
}
