#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
const int N = 1001;
bitset<N> n6[N] = {0, 14 * 2, 28 * 2, 40 * 2, 48 * 2, 37 * 2, 3 * 2}, g[N];
int main(int argc, char const *argv[]) {
  int n;
  scanf("%d", &n);
  if (n == 4) return puts("-1"), 0;
  if (n % 2 == 0) {
    for (int i = 7; i <= n; i += 2) {
      for (int j = 1; j < i; ++j) {
        n6[i][j] = n6[j][i + 1] = 1;
      }
      n6[i + 1][i] = 1;
    }
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        printf("%d ", (int)n6[i][j]);
      }
      putchar('\n');
    }
  } else {
    for (int i = 2; i <= n; i += 2) {
      for (int j = 1; j < i; ++j) {
        g[i][j] = g[j][i + 1] = 1;
      }
      g[i + 1][i] = 1;
    }
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        printf("%d ", (int)g[i][j]);
      }
      putchar('\n');
    }
  }
  return 0;
}
