#include <bits/stdc++.h>
using namespace std;
long long mp[100][100], mi[100];
int main() {
  int n;
  scanf("%d", &n);
  mi[0] = 1;
  for (int i = 1; i <= n; i++) mi[i] = mi[i - 1] * 11;
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      long long tmp = 0;
      if (j != n) tmp = tmp + i * mi[j - 1];
      if (i != n) tmp = tmp + j * mi[i - 1];
      mp[i][j] = mp[j][i] = tmp;
    }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cout << mp[i][j] << " ";
    cout << endl;
  }
}
