def get_root(region_parent_zip, region_id):
    """
    Return the penultimate `parent_id` for any `region_id`.
    
    The penultimate parent is one layer below the root (0).
    The set of penultimate parents are the distinct regions contained in the segmentation.
    They correspond to putative functional regions.

    :param tuple region_parent_zip: a list of 2-tuples of `region_ids` and `parent_ids`
    :param int region_id: the `region_id` whose root parent_id is sought
    :return int parent_id: the corresponding penultimate `parent_id` (one step below the root - value of `0`)    
    """
    if region_id == 0:
        return 0
    # derive a dictionary of region_id-->parent_id
    region_parent_dict = dict(region_parent_zip)
    # terminate when the ultimate parent is 0
    while region_parent_dict[region_id] != 0:
        # get the parent of the parent
        region_id = region_parent_dict[region_id]
    # this is the penultimate region_id
    parent_id = region_id
    return parent_id