#include <bits/stdc++.h>
using namespace std;
const int p[6][6] = {{0, 1, 0, 0, 1, 0}, {0, 0, 1, 1, 0, 0},
                     {1, 0, 0, 0, 1, 1}, {1, 0, 1, 0, 0, 0},
                     {0, 1, 0, 1, 0, 1}, {1, 1, 0, 1, 0, 0}};
int n, A[1005][1005];
int main() {
  scanf("%d", &n);
  if (n == 4)
    printf("-1\n");
  else {
    if (n % 2 == 0) {
      for (int i = 0; i < 6; i++)
        for (int j = 0; j < 6; j++) A[i][j] = p[i][j];
    }
    for (int i = n - 2; i >= ((n % 2) ? 1 : 6); i -= 2) {
      A[i][i + 1] = 1;
      for (int j = 0; j < i; j++) A[i + 1][j] = A[j][i] = 1;
    }
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) {
        printf("%d", A[i][j]);
        if (j == n - 1)
          printf("\n");
        else
          printf(" ");
      }
  }
  return 0;
}
