#include <bits/stdc++.h>
using namespace std;
int Read() {
  char c;
  while (c = getchar(), (c != '-') && (c < '0' || c > '9'))
    ;
  bool neg = (c == '-');
  int ret = (neg ? 0 : c - 48);
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + c - 48;
  return neg ? -ret : ret;
}
const int MAXN = 1005;
int N, a[MAXN][MAXN];
int main() {
  scanf("%d", &N);
  if (N == 4) return puts("-1"), 0;
  for (int i = 1; i <= N; i++) a[i][i % N + 1] = 1;
  for (int i = 1; i <= N - 2; i++)
    for (int j = i + 2; j <= N; j++)
      if (i > 1 || j < N)
        if ((j - i) & 1)
          a[j][i] = 1;
        else
          a[i][j] = 1;
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= N; j++) printf("%d%c", a[i][j], j < N ? ' ' : '\n');
  return 0;
}
