def main():
    from string import ascii_lowercase

    N = int(input())

    ans = []

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

        flg = False
        for c in ascii_lowercase:
            dfs(s + c)
            if flg: break
            if c == s[-1]:
                flg = True

    dfs()

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


if __name__ == '__main__':
    main()
