#include <bits/stdc++.h>
using namespace std;
bool graph[1010][1010];
int main(void) {
  int N, i, j;
  cin >> N;
  if (N == 4) {
    cout << "-1" << endl;
    return 0;
  }
  int n = N;
  if (n % 2 == 0) n--;
  for ((i) = 0; (i) < (int)(n); (i)++)
    for (j = 1; j <= n / 2; j++) graph[i][(i + j) % n] = true;
  if (n != N)
    for ((i) = 0; (i) < (int)(n); (i)++) {
      if (i % 2 == 0)
        graph[i][n] = true;
      else
        graph[n][i] = true;
    }
  for ((i) = 0; (i) < (int)(N); (i)++)
    for ((j) = 0; (j) < (int)(N); (j)++) {
      cout << graph[i][j];
      if (j == N - 1)
        cout << endl;
      else
        cout << ' ';
    }
  return 0;
}
