#include <bits/stdc++.h>
using namespace std;
const int N = 5000;
int a[N][N];
int main() {
  int n;
  cin >> n;
  if (n == 4) {
    cout << "-1\n";
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    a[i][i % n + 1] = 1;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (a[i][j] || a[j][i]) continue;
      if (i % 2 == j % 2)
        a[i][j] = 1;
      else
        a[j][i] = 1;
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) cout << a[i][j] << " \n"[j == n];
}
