#include <bits/stdc++.h>
int n;
bool a[1001][1001];
void work(int x) {
  for (int i = 1; i <= x; i++)
    for (int j = 1; j <= (x >> 1); j++) a[i][j + i > x ? j + i - x : j + i] = 1;
}
int main() {
  scanf("%d", &n);
  if (n == 4) return printf("-1\n"), 0;
  if (n & 1)
    work(n);
  else {
    work(n - 1);
    for (int i = 1; i < n; i++)
      if (i & 1)
        a[i][n] = 1;
      else
        a[n][i] = 1;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) printf("%d ", a[i][j]);
    puts("");
  }
  return 0;
}
