import math
import sys
import copy

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)

N = ni()

def dp(n,max):
    # print("dp",n,max)
    if max <=0: 
        return []
    if max > n:
        return s[n][n]
    else:
        return s[n][max]

def dp2(n,max):
    # print("dp",n,max)
    if max <=0: 
        return []
    if max > n:
        max = n 
    ans = copy.copy(s[n][0])
    for i in range(1,max+1):
        ans. extend(s[n][i])
    return ans

# print(N)
s= [[[[]]],[[],[[1]]]]
# print(s)
for i in range(2,N+1):
    si = [[]]
    for j in range(1,i+1):
        # print(i,j)
        jk = j - 1
        sj = []
        # print('sj',sj)
        # print('S',dp2(i-j,j))
        for c in dp2(i-j,j):
            # print('C',c)
            list = [j]
            list.extend(c)
            # print(list)
            sj.append(list)
        si.append(sj)
    # print("si",si)
    s.append(si)
    # print(s)

def output(s):
    x = []
    alpha='abcdefghijklmnop'
    out=[]
    for i in range(len(s)):
        for j in range(s[i]):
            out.append(alpha[i])
    x.append(''.join(out))
    x.sort()
    for k in x:
        print(k)


for i in range(N,0,-1):
    m = len(s[N][i])
    for j in range(m-1,-1,-1):
        output(s[N][i][j])
        