#include <bits/stdc++.h>
using namespace std;
const int maxN = 1024;
int n, i, j;
int edge[maxN][maxN];
int main() {
  scanf("%d", &n);
  if (n == 4) {
    puts("-1");
    return 0;
  }
  for (i = 0; i < n; i++) edge[i][(i + 1) % n] = 1;
  for (i = 0; i < n; i++) {
    for (j = i + 2; j < n; j++) {
      if (edge[i][j] || edge[j][i]) {
        continue;
      }
      if (i % 2 == j % 2) {
        edge[i][j] = 1;
      } else {
        edge[j][i] = 1;
      }
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      printf("%d ", edge[i][j]);
    }
    printf("\n");
  }
  return 0;
}
