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

    ans = []

    def fanc(i, l, s):
        if l == n:
            ans.append(s)
        else:
            for x in range(i+1):
                fanc(x + 1, l + 1, s + chr(97 + x))

    fanc(0, 0, "")

    ans.sort()

    for i in ans:
        print(i)

main()