program xxxxx;
type
bs=array[0..1279] of integer;
var c:bs;
p,j:longint;
procedure cheng;
var i,len:integer;
begin
len:=c[0];
for i:=1 to len do
c[i]:=c[i]*2;
for i:=1 to len do
begin
inc(c[i+1],c[i] div 10);
c[i]:=c[i] mod 10;
end;
if c[len+1]>0 then inc(len);
c[0]:=len;
end;
begin
assign(input,'mason.in');
reset(input);
assign(output,'mason.out');
rewrite(output);
read(p);
c[1]:=2;c[0]:=1;
for j:=1 to p-1 do
cheng;
if c[1]<>0 then
c[1]:=c[1]-1
else
begin
c[2]:=c[2]-1;
c[1]:=9;
end;
writeln(c[0]);
if c[0]<500 then
for j:=c[0]+1 to 500 do
c[j]:=0;
for j:=500 downto 1 do
if ((j mod 50)=1) then
writeln(c[j])
else
write(c[j]);
close(input);
close(output);
end.