import sys
sys.setrecursionlimit(1000000000)
input = sys.stdin.readline
n=int(input())
al=[chr(ord('a') + i) for i in range(15)]
def dfs(c,i):
    if i==n:
        print(c)
        return
    for k in range(ord(c[-1])-ord('a')+2):
        dfs(c+al[k],i+1)
dfs("a",1)