def dfs(s):
    if len(s)>n:
        return
    t.append(s)
    for c in 'abcdefghij':
        if -1<=ord(c)-ord(s[-1])<=1:
            dfs(s+c)

n=int(input())
if n==1:
    print('a')
    exit(0)
t=[]
ans=[]
dfs('a')

for tt in t:
    if len(tt)==n:
        ans.append(tt)
ans.sort()
print(*ans,sep='\n')