from string import ascii_lowercase k,n = map(int, raw_input().split()) cc = lambda c: ord(c)-ord('a') def construct(cur, which, last, freqs): m = sorted(freqs) if cur >= k * (k + 1) / 2: return "" for c in ascii_lowercase: if c == last: continue freqs[cc(c)] += 1 d = count(cur + 1, which + 1, c, freqs) freqs[cc(c)] -= 1 if d <= which: which -= d else: freqs[cc(c)] += 1 return c + construct(cur + 1, which, c, freqs) return "-1" mp = {} def count(cur, limit, last, freqs): m = sorted(freqs) if any((x-y<26-k-1 and x>=(26-k)) or (y>0 and x<(26-k)) for x,y in enumerate(m)): return 0 if cur >= k * (k + 1) / 2: return 1 if last != ' ': p = cc(last) ee = sorted(freqs[:p] + freqs[(p+1):]) else: ee = sorted(freqs) hh = 0 for e in ee: hh = hh * n + e x = (cur, hh) if x in mp: return mp[x] curcount = 0 for c in ascii_lowercase: if c == last: continue freqs[cc(c)] += 1 d = min(limit, count(cur + 1, limit, c, freqs)) freqs[cc(c)] -= 1 curcount += d limit -= d if limit == 0: break mp[x] = curcount return mp[x] print construct(0, n - 1, ' ', [0 for i in range(26)])