N = int(input())
def f(n,s):
    if n == 0:
        print(s)
        return
    for i in [chr(ord("a") + i) for i in range(N-n+1)]:
        if s != "" and ord(i) - ord(s[-1]) > 1:
            return 
        f(n-1,s+i)
f(N,"")