from typing import Iterable
from typing import Callable
from typing import Any
from functools import reduce


def pipeline(fns: Iterable[Callable[[Any], Any]], init_value: Any) -> Any:
    """Executes given functions in a pipeline:
    E.g.: pipeline((a, b, c), x) == c(b(a(x)))
    """
    return reduce(lambda acc, el: el(acc), fns, init_value)