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


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

    if N==1:
        print("a")
        return

    base = ord("a")  # 97
    anss = []

    def _dfs(d, now, ans):
        if d==N:
            anss.append(ans)
            return

        for i in range(base, now+2):
            _dfs(d+1, i, ans+chr(i))

    _dfs(1, base, "a")

    anss.sort()

    for ans in anss:
        print(ans)


if __name__ == "__main__":
    solve()
