# -*- coding: utf-8 -*-
import sys

def display_ans(ans):
    new_ans = []
    for a in ans:
        new_a = []
        for aa in a:
            new_a.append(chr(aa + 97))
        new_ans.append(new_a)
    
    for new_a in new_ans:
        print(''.join(new_a))

N = int(input())

ans = []

now_list = [0] * N
ans.append(now_list[:])

while True:
    for i in reversed(range(len(now_list))):
        if now_list[i - 1] == now_list[i]:
            # 平ら
            now_list[i] = now_list[i] + 1
            # 後ろがあれば初期化
            if i != N - 1:
                for j in range(i + 1, N):
                    now_list[j] = 0
            ans.append(now_list[:])
            if now_list[i] == N - 1:
                display_ans(ans)
                sys.exit()
            
            break
        elif now_list[i - 1] > now_list[i]:
            # 上がれる
            now_list[i] += 1
            # 後ろがあれば初期化
            if i != N - 1:
                for j in range(i + 1, N):
                    now_list[j] = 0
            ans.append(now_list[:])
            break
        else:
            # 下れる
            pass