#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
int n;
int adj[maxn][maxn];
int main() {
  cin >> n;
  if (n == 4) return cout << "-1", 0;
  for (int i = 1; i < n; i++) adj[i][i + 1] = 1;
  adj[n][1] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = i + 2; j <= n; j++)
      if ((i + j) % 2)
        adj[j][i] = 1;
      else
        adj[i][j] = 1;
  adj[1][n] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cout << adj[i][j] << " ";
    cout << endl;
  }
  return 0;
}
