program coin;
var
c:array [1..100] of integer;
n,r,i,j:integer;
begin
fillchar (c,sizeof(c),0);
assign (input,'coinn.in');
reset (input);
readln (n);
close (input);
assign (output,'coinn.out');
rewrite (output);
writeln (n);
r:=0;
for i:=1 to n do begin
for j:=1 to n do c[j]:=1-c[j];
j:=1;while c[j]<>1-r do inc(j);
c[j]:=r;r:=1-r;
for j:=1 to n do write (c[j]);
writeln;
end;
close (output);
end.