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

    ans = []

    def dfs(s):
        if len(s) == N:
            ans.append(s)
            return

        for c in (s[-1], chr(ord(s[-1]) + 1)):
            dfs(s + c)

    dfs('a')

    print(*ans, sep='\n')


if __name__ == '__main__':
    main()
