#include <bits/stdc++.h>
using namespace std;
bool arr[1005][1005];
int main() {
  int n;
  cin >> n;
  if (n == 4) {
    printf("-1\n");
    return 0;
  }
  int m = n;
  if (!(n & 1)) n--;
  for (int i = 2; i <= n; i += 2) {
    arr[1][i] = 1;
    if (i + 1 <= n) {
      arr[i][i + 1] = 1;
      arr[i + 1][1] = 1;
    }
    for (int j = i + 2; j <= n; j += 2) {
      arr[i][j] = 1;
      if (j + 1 <= n) arr[i + 1][j + 1] = 1;
    }
    for (int j = 2; j < i; j += 2) {
      arr[i][j + 1] = 1;
      if (i + 1 <= n) arr[i + 1][j] = 1;
    }
  }
  if (n != m) {
    arr[m][m - 1] = arr[1][m] = 1;
    for (int i = 2; i < m; i += 2) {
      arr[m][i] = 1;
      if (i + 1 < m - 1) arr[i + 1][m] = 1;
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= m; j++) cout << arr[i][j] << " ";
    cout << endl;
  }
  return 0;
}
