from typing import List
from typing import Set
from typing import Tuple
from typing import DefaultDict


def rectangle_cells(
    rectangle_tiling: List[Set[Tuple[int, int]]], tile_to_cell_dict: DefaultDict[Tuple[int, int], List[str]]
) -> List[Set[str]]:
    """
    All cells are determined that are located above combined connected components and form a rectangular scheme.

    :param rectangle_tiling: List of sets with tiles, the cells on top of which together form a rectangular scheme
    :param tile_to_cell_dict: Dict with tiles as keys and assigned list of cell ids as values.
    :return: List of set of cell ids that form a rectangular scheme
    """
    rectangle_tiling_cells: List[Set[str]] = []
    for rect_tiling_component in rectangle_tiling:
        rect_cell_component: Set[str] = set()
        for el in rect_tiling_component:
            rect_cell_component = rect_cell_component.union(set(tile_to_cell_dict[el]))
        rectangle_tiling_cells.append(rect_cell_component)
    return rectangle_tiling_cells