program dictionary;
var n,t,fact,p,r:qword;
    i:byte;
    alphabet:set of char;
    c:char;
    s:string;

function num(k:integer):char;
var i:longint;
    c:char;
begin
c:='a';
while (not (c in alphabet)) do
      c:=succ(c);
i:=0;
for i:=1 to k do
    begin
    repeat
      c:=succ(c);
    until c in alphabet;
    end;
num:=c;
end;

begin
readln(n,t);
dec(t);
s:='';
alphabet:=[];
c:='a';
fact:=1;
for i:=1 to n do
    begin
    alphabet:=alphabet+[c];
    c:=succ(c);
    fact:=fact*i;
    end;
for i:=1 to n do
    begin
    fact:=fact div (n-i+1);
    p:=t div fact;
    r:=t mod fact;
    c:=num(p);
    s:=s+c;
    alphabet:=alphabet-[c];
    t:=r;
    end;
writeln(s);
end.
