program dataa;
var
n,m,y,d:integer;
f1,f2:text;
a:array[0..10]of integer;
s:array[1..1000]of string;
procedure init;
begin
assign(f1,'dataa.in');reset(f1);
assign(f2,'dataa.out');rewrite(f2);
read(f1,n,m);
close(f1);
end;
procedure try(i:integer);
var
r,h:integer;
s1:string;
begin
for r :=1 to n-m+1 do
begin
if (y>0)and(r>=a[i-1])and(i<=m) then
begin
a[i]:=r;
y:=y-r;
if (i=m)and(y=0)then begin
inc(d);
for h:=1 to m do begin
str(a[h],s1);
s[d]:=s[d]+s1;
s[d]:=s[d]+' ';
end;
end
else try(i+1);
a[i]:=0;
y:=y+r;
end;
end;
end;
begin
init;
for y:=1 to 1000 do s[y]:='';
y:=n;
fillchar(a,sizeof(a),0);
d:=0;
try(1);
writeln(f2,d);
for y:=1 to d do
writeln(f2,s[y]);
close(f2);
end.