n = int(input())
def dfs(i,s):
    if i == n:
        print(s)
        return
    for j in range(i+1):
        if ord(s[-1]) == 97+j or ord(s[-1]) + 1 == 97+j:
            dfs(i+1,s+chr(97+j))
    return
dfs(1,"a")