import java.util.*;
import java.io.*;
import java.math.*;
class Solver {
new Solver().run();
}
in.nextToken();
return (int)in.nval;
}
solve();
out.flush();
}
int n = nextInt();
int[][] G = new int[n][n];
if(n == 4)
out.println("-1");
else{
for(int i = 0; i < n; i++)
G[i][(i+1)%n] = 1;
for(int y = 0; y < n; y++){
for(int x = 0; x < n; x++){
if(G[y][x] + G[x][y] == 0 && x != y){
if(y % 2 == x % 2) G[y][x] = 1;
else G[x][y] = 1;
}
}
}
for(int y = 0; y < n; y++){
for(int x = 0; x < n-1; x++){
out.print(G[y][x]);
out.print(" ");
}
out.println(G[y][n-1]);
}
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5pby4qOwppbXBvcnQgamF2YS5tYXRoLio7CiAKY2xhc3MgU29sdmVyIHsJCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmcgYXJnc1tdKSB0aHJvd3MgSU9FeGNlcHRpb257CiAgICAJbmV3IFNvbHZlcigpLnJ1bigpOwoJfQoKCVN0cmVhbVRva2VuaXplciBpbjsKCVByaW50V3JpdGVyIG91dDsKCglpbnQgbmV4dEludCgpIHRocm93cyBJT0V4Y2VwdGlvbnsKCQlpbi5uZXh0VG9rZW4oKTsKCQlyZXR1cm4gKGludClpbi5udmFsOwoJfQoJdm9pZCBydW4oKSB0aHJvd3MgSU9FeGNlcHRpb257CgkJaW4gPSBuZXcgU3RyZWFtVG9rZW5pemVyKG5ldyBCdWZmZXJlZFJlYWRlcihuZXcgSW5wdXRTdHJlYW1SZWFkZXIoU3lzdGVtLmluKSkpOwoJCW91dCA9IG5ldyBQcmludFdyaXRlcihuZXcgT3V0cHV0U3RyZWFtV3JpdGVyKFN5c3RlbS5vdXQpKTsKCQlzb2x2ZSgpOwoJCW91dC5mbHVzaCgpOwoJfQoJdm9pZCBzb2x2ZSgpIHRocm93cyBJT0V4Y2VwdGlvbnsKCQlpbnQgbiA9IG5leHRJbnQoKTsKICAgIAlpbnRbXV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