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