#!/usr/bin/env python3
import sys


def solve(N: int):
    def f(i, pre):
        if i == N:
            yield ""
            return
        for s in f(i+1, ord('a')):
            yield s + "a"
        for s in f(i+1, pre+1):
            yield s + chr(pre+1)
    return ['a' + s for s in f(1, ord('a'))]


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    print(*solve(N), sep="\n")

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()
