#include <bits/stdc++.h>
using namespace std;
int a[1008][1008];
int main() {
  int n;
  scanf("%d", &n);
  if (n == 4) {
    printf("-1\n");
    return 0;
  }
  for (int i = 0; i < n; i++) a[i][(i + 1) % n] = 1;
  for (int i = 0; i < n; i++)
    for (int j = i + 2; j < n; j++)
      if (j - i & 1)
        a[j][i] = 1;
      else
        a[i][j] = 1;
  a[0][n - 1] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) printf("%d ", a[i][j]);
    printf("\n");
  }
  return 0;
}
