from typing import Iterable


def prod_algs(iterable: Iterable, default=None):
    """Return prod of elements in algebras."""
    it = iter(iterable)
    initial = next(it) if default is None else default
    result = initial.data
    for x in it:
        result = x.mul_data(result, x.data)
    return type(initial)(result)