#include <bits/stdc++.h>
using namespace std;
int mp[100][100];
int main() {
  srand(time(NULL));
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) mp[i][j] = mp[j][i] = rand();
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cout << mp[i][j] << " ";
    cout << endl;
  }
}
