#include <bits/stdc++.h>
using namespace std;
const int maxN = 20 + 5;
const int maxL = 1000 + 5;
bool mark[maxL];
int n;
int val[maxN];
int cost[maxN][maxN];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    val[i] = -1;
    for (int j = 1; j < i; j++)
      for (int z = j + 1; z < i; z++) {
        for (int t = 1; t < i; t++) {
          int tmp = val[j] + val[z] - val[t];
          if (tmp >= 0) mark[tmp] = true;
        }
      }
    for (int j = 0; j <= 1000; j++)
      if (!mark[j]) {
        val[i] = j;
        break;
      }
    if (val[i] == -1) {
      cout << -1 << endl;
      return 0;
    }
    memset(mark, false, sizeof mark);
    for (int j = 1; j <= i; j++) mark[val[j]] = true;
  }
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) cost[i][j] = cost[j][i] = val[i] + val[j];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cout << cost[i][j] << ' ';
    cout << endl;
  }
  return 0;
}
