#include <bits/stdc++.h>
using namespace std;
int A[1002][1002];
int main() {
  int n, i, j, k;
  scanf("%d", &n);
  memset(A, 0, sizeof(A));
  if (n == 4) {
    puts("-1");
    return 0;
  }
  if (~n & 1) {
    for (i = 0; i < n; i++) {
      for (j = i + 1; j < n && j < i + n / 2; j++) A[i][j] = 1;
      for (; j < n; j++) A[j][i] = 1;
    }
    A[1][n - 1] = 1;
    A[n - 1][1] = 0;
  } else {
    for (i = 0; i < n; i++) {
      j = (i + 1) % n;
      while (j > i) A[i][j] = 1, j = (j + 2) % n;
      while (j < i) A[i][j] = 1, j = (j + 2) % n;
    }
  }
  for (i = 0; i < n; i++) {
    printf("%d", A[i][0]);
    for (j = 1; j < n; j++) printf(" %d", A[i][j]);
    puts("");
  }
}
