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>
template <typename T>
inline T Min(const T a, const T b) {
  return a < b ? a : b;
}
bool IsValid(std::vector<std::vector<size_t> >& a, const size_t n) {
  for (size_t i = 0; i < n; i++)
    for (size_t j = 0; j < n; j++) {
      if ((i == j) && (a[i][i] != 0)) return false;
      if ((i != j) && (a[i][j] + a[j][i] != 1)) return false;
    }
  std::vector<std::vector<size_t> > w(n, std::vector<size_t>(n));
  for (size_t i = 0; i < n; i++)
    for (size_t j = 0; j < n; j++) {
      if (i != j) w[i][j] = (a[i][j] == 1) ? 1 : 9999;
    }
  for (size_t k = 0; k < n; k++)
    for (size_t i = 0; i < n; i++)
      for (size_t j = 0; j < n; j++) w[i][j] = Min(w[i][j], w[i][k] + w[k][j]);
  for (size_t i = 0; i < n; i++)
    for (size_t j = 0; j < n; j++)
      if (w[i][j] > 2) return false;
  return true;
}
void GetNext(const size_t n, size_t& i, size_t& j) {
  j++;
  if (j == n) {
    i++;
    j = i + 1;
  }
}
bool TryNextCell(std::vector<std::vector<size_t> >& a, const size_t n,
                 const size_t i, const size_t j) {
  if (i + 1 == n) {
    const bool isOk = IsValid(a, n);
    return isOk;
  }
  size_t ni = i;
  size_t nj = j;
  GetNext(n, ni, nj);
  a[i][j] = 1;
  a[j][i] = 0;
  if (TryNextCell(a, n, ni, nj)) return true;
  a[i][j] = 0;
  a[j][i] = 1;
  if (TryNextCell(a, n, ni, nj)) return true;
  return false;
}
void ProcessNextCell(std::vector<std::vector<size_t> >& a, const size_t n,
                     const size_t i, const size_t j,
                     std::vector<std::vector<std::vector<size_t> > >& answers) {
  if (i + 1 == n) {
    if (IsValid(a, n)) answers.push_back(a);
    return;
  }
  size_t ni = i;
  size_t nj = j;
  GetNext(n, ni, nj);
  a[i][j] = 1;
  a[j][i] = 0;
  ProcessNextCell(a, n, ni, nj, answers);
  a[i][j] = 0;
  a[j][i] = 1;
  ProcessNextCell(a, n, ni, nj, answers);
}
bool AreEqualSolutions(const std::vector<std::vector<size_t> >& a1,
                       const std::vector<std::vector<size_t> >& a2,
                       const size_t n) {
  std::vector<size_t> p(n);
  for (size_t i = 0; i < n; i++) p[i] = i;
  do {
    bool isEqual = true;
    for (size_t i = 0; i < n && isEqual; i++)
      for (size_t j = 0; j < n && isEqual; j++) {
        const size_t pi = p[i];
        const size_t pj = p[j];
        if (a1[i][j] != a2[pi][pj]) isEqual = false;
      }
    if (isEqual) return true;
  } while (std::next_permutation(p.begin(), p.end()));
  return false;
}
bool FindSolution(std::vector<std::vector<size_t> >& a, const size_t n) {
  for (size_t i = 0; i < n; i++)
    for (size_t j = 0; j < n; j++) a[i][j] = 0;
  const bool isOk = TryNextCell(a, n, 0, 1);
  return isOk;
}
bool FillForSix(std::vector<std::vector<size_t> >& a) {
  return FindSolution(a, 6);
}
void FillForSixAll(std::vector<std::vector<size_t> >& a,
                   std::vector<std::vector<std::vector<size_t> > >& answers) {
  const size_t n = 6;
  for (size_t i = 0; i < n; i++)
    for (size_t j = 0; j < n; j++) a[i][j] = 0;
  answers.clear();
  ProcessNextCell(a, n, 0, 1, answers);
}
void AddTwo(std::vector<std::vector<size_t> >& a, const size_t p,
            const size_t x, const size_t y) {
  a[x][y] = 1;
  for (size_t i = 0; i < p; i++) {
    a[i][x] = 1;
    a[y][i] = 1;
  }
}
void PrintGraph(std::ostream& ost, const std::vector<std::vector<size_t> >& a) {
  const size_t n = a.size();
  std::string out(2 * n + 1, ' ');
  for (size_t i = 0; i < n; i++) {
    for (size_t j = 0; j < n; j++) {
      out[2 * j] = a[i][j] ? '1' : '0';
    }
    ost << out << std::endl;
  }
}
bool Solve(std::istream& ist, std::ostream& ost, const bool multipleTestMode) {
  size_t n;
  ist >> n;
  if (multipleTestMode && !ist) return false;
  if (n == 4 || n == 2) {
    ost << "-1" << std::endl;
    return multipleTestMode;
  }
  std::vector<std::vector<size_t> > a(n, std::vector<size_t>(n));
  if (n % 2 == 0) {
    FillForSix(a);
    for (size_t p = 6; p + 1 < n; p += 2) {
      AddTwo(a, p, p + 0, p + 1);
    }
  } else {
    for (size_t p = 1; p + 1 < n; p += 2) {
      AddTwo(a, p, p + 0, p + 1);
    }
  }
  PrintGraph(ost, a);
  return multipleTestMode;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  std::istream& ist = std::cin;
  std::ostream& ost = std::cout;
  Solve(ist, ost, false);
}