program xmz;
var
x:array[1..32]of longint;
aa,s,h,n,k:longint;
f1,f2:text;
procedure dfs(w,a:longint);
var i:longint;
begin
for i:=a to n do
begin
x[w]:=i;
s:=s+1;
if s=k then begin for aa:=1 to w do
write(f2,x[aa],' ');close(f1);close(f2);halt;end;
dfs(w+1,i+1);
end;
end;
begin
assign(f1,'sort.in');assign(f2,'sort.out');
reset(f1);rewrite(f2);
read(f1,n,k);k:=k-1;
if k=0 then write(f2,0) else dfs(1,1);
close(f1);close(f2);
end.