var a:array of byte;
n,s,c,k,k1,a1,a2,g:byte;
i,r,max,e:integer;
begin
read(n,s);
writeln;
setlength(a,n);
i:=1;
for c:=1 to n-1 do i*=10;
max:=i*10-1;
for i:=i to max do begin
r:=i;
k:=0;
k1:=0;
g:=0;
for a1:=0 to n-1 do begin
k:=r mod 10;
r:=r div 10;
inc(k1,k);
a[a1]:=k;
end;
for a1:=0 to n-1 do
for a2:=0 to n-1 do
if (a[a2]=a[a1]) and (a1<>a2) then inc(g);
if (g=0) and (k1=s) then begin
write(i,' ');
inc(e);
end;
end;
if e=0 then write('NU EXISTA');
end.