/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{ int n;
Scanner sc
= new Scanner
(System.
in); n=sc.nextInt();
int[][] matrix;
matrix = new int[n][n];
for(int i=0;i < n;i++){
matrix[i][i]=1;
}
for(int i=0;i<n;i++){
for(int y=0;y<n;y++){
if(matrix[i][y]!=1){
matrix[i][y]=0;
}
}
}
for(int i=0;i<n;i++){
for(int y=0;y<n;y++){
System.
out.
print(matrix
[i
][y
]); }
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJeyAgaW50IG47CiAgICAgICAgIFNjYW5uZXIgc2MgPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOyAKICAgICAgICAgbj1zYy5uZXh0SW50KCk7CiAgICAgICAgIGludFtdW10gbWF0cml4OwogICAgICAgICBtYXRyaXggPSBuZXcgaW50W25dW25dOwogICAgICAgICBmb3IoaW50IGk9MDtpIDwgbjtpKyspewogICAgICAgICAgICBtYXRyaXhbaV1baV09MTsKICAgICAgICAgfQogICAgICAgICBmb3IoaW50IGk9MDtpPG47aSsrKXsKICAgICAgICAgICAgZm9yKGludCB5PTA7eTxuO3krKyl7CiAgICAgICAgICAgICAgICBpZihtYXRyaXhbaV1beV0hPTEpewogICAgICAgICAgICAgICAgICAgIG1hdHJpeFtpXVt5XT0wOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgZm9yKGludCBpPTA7aTxuO2krKyl7CiAgICAgICAgICAgIGZvcihpbnQgeT0wO3k8bjt5KyspewogICAgICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludChtYXRyaXhbaV1beV0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIlxuIik7CiAgICAgICAgIH0KCX0KfQ==