def main():
    from string import ascii_lowercase
    N = int(input())
    ascii_dic = {i: a for i, a in enumerate(ascii_lowercase)}
    ascii_rdic = {a: i for i, a in enumerate(ascii_lowercase)}

    def dfs(A):
        if len(A) == N:
            print("".join(A))
            return
        if not A:
            dfs(["a"])
        else:
            s = ascii_rdic[A[-1]]
            for i in range(s+2):
                dfs(A + [ascii_dic[i]])

    dfs([])


if __name__ == '__main__':
    main()
