#include <bits/stdc++.h>
using namespace std;
void desperate_optimization(int precision) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios::fixed);
  cout.setf(ios::showpoint);
  cout.precision(precision);
}
const int N = 10;
const long long MAXN = 1e6;
const long long MOD = 1e9 + 9;
long long arr[N + 5][N + 5];
vector<int> vec;
map<long long, long long> ms;
long long randomw() {
  long long res = 0;
  for (int i = 0; i < 26; i++) {
    long long u = rand() % MOD + 1;
    if (u % 2)
      res = (res + u) % MOD;
    else
      res = (res * u) % MOD;
  }
  return res;
}
void hora(int tc) {
  srand(time(NULL));
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) arr[i][j] = arr[j][i] = randomw();
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j) cout << " ";
      cout << arr[i][j];
    }
    cout << endl;
  }
}
int main() {
  int ntc = 1;
  for (int tc = 1; tc <= ntc; tc++) hora(tc);
  return 0;
}
