#include <cstdio>
unsigned G[1000][1000];
int main()
{
unsigned n; scanf("%u", &n);
if(n == 4){
puts("-1");
return 0;
}
for(size_t i = 0; i < n; i++){
G[i][(i+1)%n] = 1;
}
for(size_t i = 0; i < n; i++){
for(size_t j = 0; j < n; j++){
if(G[i][j] + G[j][i] == 0 && i != j){
if(i % 2 == j % 2)
G[i][j] = 1;
else
G[j][i] = 1;
}
}
}
for(size_t i = 0; i < n; i++){
for(size_t j = 0; j < n; j++){
printf("%u ", G[i][j]);
}
puts("");
}
return 0;
}
I2luY2x1ZGUgPGNzdGRpbz4KCnVuc2lnbmVkIEdbMTAwMF1bMTAwMF07CgppbnQgbWFpbigpCnsKICAgIHVuc2lnbmVkIG47IHNjYW5mKCIldSIsICZuKTsKICAgIGlmKG4gPT0gNCl7CiAgICAgICAgcHV0cygiLTEiKTsKICAgICAgICByZXR1cm4gMDsKICAgIH0KICAgIGZvcihzaXplX3QgaSA9IDA7IGkgPCBuOyBpKyspewogICAgICAgIEdbaV1bKGkrMSklbl0gPSAxOwogICAgfQogICAgZm9yKHNpemVfdCBpID0gMDsgaSA8IG47IGkrKyl7CiAgICAgICAgZm9yKHNpemVfdCBqID0gMDsgaiA8IG47IGorKyl7CiAgICAgICAgICAgIGlmKEdbaV1bal0gKyBHW2pdW2ldID09IDAgJiYgaSAhPSBqKXsKICAgICAgICAgICAgICAgIGlmKGkgJSAyID09IGogJSAyKQogICAgICAgICAgICAgICAgICAgIEdbaV1bal0gPSAxOwogICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgIEdbal1baV0gPSAxOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgZm9yKHNpemVfdCBpID0gMDsgaSA8IG47IGkrKyl7CiAgICAgICAgZm9yKHNpemVfdCBqID0gMDsgaiA8IG47IGorKyl7CiAgICAgICAgICAgIHByaW50ZigiJXUgIiwgR1tpXVtqXSk7CiAgICAgICAgfQogICAgICAgIHB1dHMoIiIpOwogICAgfQogICAgcmV0dXJuIDA7Cn0K