import sys
sys.setrecursionlimit(10**9)

ordA = ord('a')

N = int(input())

def dfs(i, sSt):
    if i == N:
#        print(Ss)
        ans = ''.join([chr(ordA+S) for S in Ss])
        anss.append(ans)
    else:
        for s in range(0, sSt+2):
            Ss[i] = s
            dfs(i+1, s)

anss = []
Ss = [0] * N
dfs(1, 0)

print('\n'.join(anss))
