#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}
long long min(long long a, long long b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}
int ma[1001][1001];
int main() {
  int k;
  cin >> k;
  if (k - 4 == 0) {
    cout << -1 << endl;
    return 0;
  }
  memset(ma, 0, sizeof(ma));
  for (long long i = 1; i <= k; i++) {
    for (long long j = i + 1; j <= k; j++) {
      if ((i + j) % 2 == 1) {
        ma[i][j] = 1;
      } else {
        ma[j][i] = 1;
      }
    }
  }
  if (k % 2 == 0) {
    ma[3][k] = 0;
    ma[k][3] = 1;
  }
  for (long long i = 1; i <= k; i++) {
    for (long long j = 1; j <= k; j++) {
      cout << ma[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
