import itertools


def unflatten2(flat_list, cumlen_list):
    """Rebuilds unflat list from invertible_flatten1

    Args:
        flat_list (list): the flattened list
        cumlen_list (list): the list which undoes flattenting

    Returns:
        unflat_list2: original nested list

    SeeAlso:
        invertible_flatten1
        invertible_flatten2
        unflatten2

    Example:
        >>> # ENABLE_DOCTEST
        >>> from utool.util_list import *  # NOQA
        >>> import utool
        >>> utool.util_list
        >>> flat_list = [5, 2, 3, 12, 3, 3, 9, 13, 3, 5]
        >>> cumlen_list = [ 1,  6,  7,  9, 10]
        >>> unflat_list2 = unflatten2(flat_list, cumlen_list)
        >>> result = (unflat_list2)
        >>> print(result)
        [[5], [2, 3, 12, 3, 3], [9], [13, 3], [5]]
    """
    unflat_list2 = [
        flat_list[low:high]
        for low, high in zip(itertools.chain([0], cumlen_list), cumlen_list)
    ]
    return unflat_list2