N = int(input())
ans = []
def dfs(s):
    if(len(s) == N):
        ans.append(s)
        return
    else:
        next_str = ord(s[-1]) + 1
        for i in range(ord("a"), next_str + 1):
            dfs(s + chr(i))

dfs("a")

ans = sorted(ans)
for a in ans:
    print(a)
