program sort;
var
t,n,k:longint;
s:array [0..31] of byte;
procedure put(len:integer);
var i:integer;
begin
if t<>k then for i:=s[len-1]+1 to n do begin
inc(t);
s[len]:=i;
put(len+1);
s[len]:=0;
end
else begin
write (s[1]);
for i:=2 to len-1 do write (' ',s[i]);
writeln;
close (output);
halt;
end;
end;
begin
fillchar (s,sizeof(s),0);
assign (input,'sort.in');
reset (input);
readln (n,k);
dec(k);
close (input);
assign (output,'sort.out');
rewrite (output);
t:=0;
if k=0 then writeln (0) else put(1);
end.