n = int(input())
def dfs(d, val, alp):
    if d == n:
        alp.append(val)
        return
    for i in range (ord('a'), ord(val[-1]) + 2):
        nval = val + chr(i)
        dfs(d+1, nval , alp)

alp = []
dfs(1, 'a', alp)
for i in range(len(alp)):
    print(alp[i])