import string
#n = int(input())
n = 5
cs = string.ascii_lowercase
cm = {cs[i]:i for i in range(len(cs))}

def rec(st, m):
    if (len(st) >= n):
        print(st)
        return 0
    for c in cs[:m+1]:
        rec(st + c,max(cm[c]+1,m))

rec('a',1)