#include <bits/stdc++.h>
const int N = 1e3 + 5;
int n, a[N][N];
int main() {
  scanf("%d", &n);
  if (n == 4) return puts("-1"), 0;
  if (n & 1)
    for (int i = 0; i < n; ++i)
      for (int j = 1; j <= (n - 1) / 2; ++j) a[i][(i + j) % n] = 1;
  else {
    --n;
    for (int i = 0; i < n; ++i)
      for (int j = 1; j <= (n - 1) / 2; ++j) a[i][(i + j) % n] = 1;
    for (int i = 0; i < n; ++i)
      if (i & 1)
        a[i][n] = 1;
      else
        a[n][i] = 1;
    ++n;
  }
  for (int i = 0; i < n; ++i, putchar('\n'))
    for (int j = 0; j < n; ++j) {
      if (j) putchar(' ');
      putchar('0' + a[i][j]);
    }
  return 0;
}
