n = int(input())

alphabet = "abcdefghijk"


def dfs(k):
    if k == 1:
        return ["a"]

    ret = []
    for r in dfs(k - 1):
        ret += [r + t for t in alphabet[:k]]

    return ret


print("\n".join(dfs(n)))