#include <bits/stdc++.h>
using namespace std;
int n;
bool mat[1005][1005];
void Work() {
  mat[1][2] = true;
  mat[2][3] = true;
  mat[3][1] = true;
  for (int i = 4; i <= n; i++) {
    if (i & 1) {
      for (int j = 1; j < i; j += 2) mat[j][i] = true;
      for (int j = 2; j < i; j += 2) mat[i][j] = true;
    } else {
      if (i != n) {
        for (int j = 1; j < i; j += 2) mat[i][j] = true;
        for (int j = 2; j < i; j += 2) mat[j][i] = true;
      } else {
        for (int j = 1; j < n / 2; j++) mat[i][j] = true;
        for (int j = n / 2; j < n; j++) mat[j][i] = true;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) printf("%d ", mat[i][j]);
    printf("\n");
  }
  return;
}
int main() {
  scanf("%d", &n);
  if (n == 4)
    printf("-1");
  else
    Work();
  return 0;
}
