Problem: In this problem you have to build tournament graph, consisting of n vertices, such, that for any oriented pair of vertices (v, u) (v ≠ u) there exists a path from vertex v to vertex u consisting of no more then two edges.

A directed graph without self-loops is a tournament, if there is exactly one edge between any two distinct vertices (in one out of two possible directions).

Input

The first line contains an integer n (3 ≤ n ≤ 1000), the number of the graph's vertices.

Output

Print -1 if there is no graph, satisfying the described conditions.

Otherwise, print n lines with n integers in each. The numbers should be separated with spaces. That is adjacency matrix a of the found tournament. Consider the graph vertices to be numbered with integers from 1 to n. Then av, u = 0, if there is no edge from v to u, and av, u = 1 if there is one. 

As the output graph has to be a tournament, following equalities must be satisfied: 

  * av, u + au, v = 1 for each v, u (1 ≤ v, u ≤ n; v ≠ u); 
  * av, v = 0 for each v (1 ≤ v ≤ n). 

Examples

Input

3


Output

0 1 0
0 0 1
1 0 0


Input

4


Output

-1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,abm,mmx,avx,avx2,popcnt,tune=native")
#pragma GCC optimize("SEX_ON_THE_BEACH")
#pragma comment(linker, "/STACK:36777216")
using namespace std;
const int MAXN = 6e3 + 28;
const int inf = 1e9;
const long double PI = acos(-1);
const int mod = (int)998244353;
const int MOD = 1000000007;
const int MOD9 = 1000000009;
const int a228 = 18;
const long double obr = (long double)1 / sqrt(2);
int fl[7][7];
inline bool check(vector<pair<int, int>> &a) {
  for (int i = 1; i <= 6; ++i)
    for (int j = 1; j <= 6; ++j) fl[i][j] = inf;
  for (int i = 1; i < 7; ++i) fl[i][i] = 0;
  for (auto i : a) fl[i.first][i.second] = 1;
  for (int k = 1; k <= 6; ++k) {
    for (int i = 1; i <= 6; ++i) {
      for (int j = 1; j <= 6; ++j) {
        fl[i][j] = min(fl[i][j], fl[i][k] + fl[k][j]);
      }
    }
  }
  int n = 6;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (fl[i][j] > 2) {
        return 0;
      }
    }
  }
  return 1;
}
vector<pair<int, int>> ans;
void gen() {
  int n = 6;
  vector<pair<int, int>> a;
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) a.push_back({i, j});
  }
  for (int msk = 0; msk < (1 << 15); ++msk) {
    auto x = a;
    for (int j = 0; j < 15; ++j) {
      if ((msk >> j) & 1) swap(x[j].first, x[j].second);
    }
    if (check(x)) {
      ans = x;
      return;
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  srand(time(NULL));
  int n;
  cin >> n;
  if (n == 4) {
    cout << -1;
    return 0;
  }
  vector<vector<int>> g(n + 1, vector<int>(n + 1));
  if (n % 2) {
    g[1][2] = g[2][3] = g[3][1] = 1;
    for (int v = 4; v < n; v += 2) {
      g[v][v + 1] = 1;
      for (int i = 1; i < v; ++i) g[i][v] = 1, g[v + 1][i] = 1;
    }
  } else {
    vector<int> unusen = {};
    gen();
    for (auto i : ans) g[i.first][i.second] = 1;
    for (int v = 7; v < n; v += 2) {
      g[v][v + 1] = 1;
      for (int i = 1; i < v; ++i) g[i][v] = 1, g[v + 1][i] = 1;
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      cout << g[i][j] << ' ';
    }
    cout << endl;
  }
}