#include <bits/stdc++.h>
int g[1003][1003];
int main() {
  int n;
  scanf("%d", &n);
  if (n == 4 || n == 2) return puts("-1"), 0;
  int cur = 3;
  g[1][2] = g[2][3] = g[3][1] = 1;
  if (n % 2 == 0) {
    g[6][5] = g[5][4] = g[4][6] = 1;
    for (int i = 4; i <= 6; i++)
      for (int j = 1; j <= 3; j++)
        if (j + 3 == i)
          g[i][j] = 1;
        else
          g[j][i] = 1;
    cur = 6;
  }
  for (int i = cur + 1; i < n; i += 2) {
    for (int k = 1; k < i; k++) g[i][k] = g[k][i + 1] = 1;
    g[i + 1][i] = 1;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) printf("%d%c", g[i][j], " \n"[j == n]);
  return 0;
}
