# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


def main():
    N = int(input())

    dp = [[] for _ in range(N)]
    dp[0] = ['a']

    alpha = 'abcdefghijk'

    for i in range(1,N):
        res = []
        pre = dp[i-1]
        for s in pre:
            for j in range(i+1):
                temp = s + alpha[j]
                res.append(temp)
        dp[i] = res

    res = dp[N-1]

    for i in res:
        print(i)



main()
