#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    set<int> S;
    int a[n][n];
    int b[n];
    int num = 1;
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    b[0] = 1;
    num++;
    for (int i = 1; i < n; i++) {
      bool flag = false;
      while (flag == false) {
        flag = true;
        for (int j = 0; j < i; j++) {
          if (S.find(num + b[j]) != S.end()) {
            flag = false;
            num++;
            break;
          }
        }
      }
      b[i] = num;
      num++;
      for (int j = 0; j < i; j++) {
        a[i][j] = b[i] + b[j];
        a[j][i] = a[i][j];
        S.insert(a[i][j]);
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (j != 0) cout << " ";
        cout << a[i][j];
      }
      cout << endl;
    }
  }
  return 0;
}
