#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v;
  for (int i = 0; i < 1000; i++) {
    bool flag = true;
    for (int a : v) {
      for (int b : v) {
        if (a == b) {
          continue;
        }
        for (int c : v) {
          if (a + b == c + i) {
            flag = false;
            break;
          }
        }
      }
    }
    if (flag) {
      v.push_back(i);
    }
    if (v.size() == n) {
      break;
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i == j) {
        cout << "0 ";
      } else {
        cout << v[i] + v[j] << " ";
      }
    }
    cout << endl;
  }
  return 0;
}
