from typing import Iterable
from typing import Any
from typing import List
from functools import reduce


def flatten(lists: Iterable[Iterable[Any]]) -> List[Any]:
    """Recursively flatten nested lists."""
    return reduce(
        lambda res, x: res + (flatten(x) if isinstance(x, list) else [x]),
        lists,
        [],
    )