n = str(input())
num2alpha = lambda c: chr(c+97)

def plus(string):
    tmp = []
    for i in range(0,min(int(n)+1,max_value(string)+2)):
        tmp.append(string+str(i))
    return tmp

def max_value(string):
    tmp = []
    for a in list(string):
        tmp.append(int(a))
    return max(tmp)

if n == "1":
    print("a")
else:
    ans = ["0"]
    for i in range(int(n)-1):
        for j,a in enumerate(ans):
            ans[j] = plus(a)
        ans = sum(ans,[])
    for i in ans:
        for j in list(i):
            print(num2alpha(int(j)),end="")
        print()