#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1000 + 10;
int n;
bool ans[Maxn][Maxn];
int main() {
  cin >> n;
  if (n == 4) {
    cout << -1 << endl;
    return 0;
  }
  int p;
  if (n % 2 == 1) {
    ans[0][1] = ans[1][2] = ans[2][0] = true;
    p = 3;
  } else {
    ans[0][2] = ans[0][5] = ans[1][3] = ans[1][5] = ans[1][0] = ans[2][1] =
        ans[2][4] = ans[3][2] = ans[3][0] = ans[3][4] = ans[4][0] = ans[4][1] =
            ans[5][3] = ans[5][4] = ans[5][2] = true;
    p = 6;
  }
  for (int i = p; i < n; i += 2) {
    ans[i][i + 1] = true;
    for (int j = 0; j < i; j++) ans[j][i] = ans[i + 1][j] = true;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << ans[i][j] << " ";
    cout << endl;
  }
  return 0;
}
