var
	i, j, p, n: longint;
	a: array [1..200, 1..200] of longint;

function testCircular(i: longint): boolean;
var
	j, k, p: longint;
	match: boolean;
begin
	for j := 1 to n - 1 do begin
		match := true;
		for k := 1 to n do begin
			p := k + j;
			if (p > n) then p := p - n;
			if (a[i][k] <> a[i][p]) then
				match := false;
		end;
		if match then begin
			testCircular := true;
			exit;
		end;
	end;
	testCircular := false;
end;

begin
	randseed := 20927340;

	n := 199;
	p := 3;
	for i := 1 to n do begin
		repeat
    		for j := 1 to n do begin
    			a[i][j] := 0;
    			if random(100) < p then
    				a[i][j] := 1;
    		end;
    	until not testCircular(i);
	end;

	writeln(n);
	for i := 1 to n do begin
		for j := 1 to n do begin
			write(a[i][j]);
		end;
		writeln;
	end;
end.