program mason(input,output);
var
a:array[1..500]of integer;
i,j,k,p:integer;
procedure clean;
var i:integer;
begin
for i:=1 to 500 do
a[i]:=0;
end;
begin
assign(input,'mason.in');assign(output,'mason.out');
reset(input);rewrite(output);
read(input,p);
clean;
a[1]:=2;k:=1;
for i:=2 to p do begin
for j:=k downto 1 do begin
a[j]:=a[j]*2;
if a[j]>=10 then begin
a[j+1]:=a[j+1]+1;
a[j]:=a[j]-10;
end;
end;
if a[k+1]<>0 then k:=k+1;
end;
writeln(output,trunc(p*ln(2)/ln(10))+1);
for i:=500 downto 1 do
if ((i-1)mod 50)=0 then writeln(a[i]) else write(a[i]);
end.