#include <bits/stdc++.h>
using namespace std;
const long long M = 1000000000ll;
int n, h, d, i, j, k;
long long ans, g[15][15], p[1005];
int main() {
  scanf("%d", &n);
  srand(998244353);
  p[0] = 1;
  for (i = 1; i <= 1000; i++)
    p[i] = (p[i - 1] * rand() % M * rand() % M + rand() * rand() % M) % M;
  sort(p + 1, p + 1000);
  for (i = 1; i <= n; i++)
    for (j = i + 1; j <= n; j++) {
      k += 10;
      while (p[k] == p[k - 1]) k++;
      g[i][j] = p[k] + 1;
    }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++)
      if (i <= j)
        cout << g[i][j] << ' ';
      else
        cout << g[j][i] << ' ';
    cout << endl;
  }
}
