#include <bits/stdc++.h>
unsigned G[1000][1000];
int main() {
  unsigned n;
  scanf("%u", &n);
  if (n == 4) {
    puts("-1");
  } else {
    for (size_t i = 0; i < n; i++) {
      G[i][(i + 1) % n] = 1;
    }
    for (size_t i = 0; i < n; i++) {
      for (size_t j = 0; j < n; j++) {
        if (G[i][j] + G[j][i] == 0 && i != j) {
          if (i % 2 == j % 2)
            G[i][j] = 1;
          else
            G[j][i] = 1;
        }
      }
    }
    for (size_t i = 0; i < n; i++) {
      for (size_t j = 0; j < n - 1; j++) {
        printf("%u ", G[i][j]);
      }
      printf("%u\n", G[i][n - 1]);
    }
  }
  return 0;
}
