import sys
sys.setrecursionlimit(10 ** 6)
n = int(input())
ans = []
def bfs(s):
    if len(s)==n:
        ans.append(s)
        return
    for i in range(ord('a'),ord(s[-1])+2):
        bfs(s+chr(i))
bfs('a')
ans.sort()
print(*ans,sep='\n')