#include <bits/stdc++.h>
using namespace std;
int n;
int s[22];
bool used[1111] = {};
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int put = i + 1; put <= 1000; put++) {
      bool can = true;
      for (int u = 0; u < i; u++) {
        if (used[s[u] + put]) {
          can = false;
          break;
        }
      }
      if (can) {
        for (int u = 0; u < i; u++) {
          used[s[u] + put] = true;
        }
        s[i] = put;
        break;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int u = 0; u < n; u++) {
      if (i == u)
        cout << "0 ";
      else
        cout << s[i] + s[u] << ' ';
    }
    cout << endl;
  }
  return 0;
}
