import sys
sys.setrecursionlimit(10**7)
def dfs(s):
    if len(s)==N:
        li.append(s)
        return
    o=ord(s[-1])
    for c in range(97,o+2):
        dfs(s+chr(c))

N=int(input())
li=[]
dfs('a')
print(*li,sep='\n')