#include <bits/stdc++.h>
int n;
int a[1010][1010];
int b[1010][1010];
int main() {
  scanf("%d", &n);
  if (n == 2 || n == 4)
    puts("-1");
  else {
    for (int i = 0; i < n; ++i) a[i][(i + 1) % n] = 1;
    for (int i = 0; i < n; ++i)
      for (int j = (i + 1) % n, p = -1; j != i; j = (j + 1) % n, p = -p) {
        if (a[i][j] || a[j][i]) continue;
        p > 0 ? a[i][j] = 1 : a[j][i] = 1;
      }
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) printf("%d ", a[i][j]);
      puts("");
    }
  }
  return 0;
}
