<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compress_flood_fill_regions(targets):
 """Generate a reduced set of flood fill parameters. Parameters For each used chip a set of core numbers onto which an application should be loaded. E.g., the output of :py:func:`~rig.place_and_route.util.build_application_map` when indexed by an application. Yields ------ (region, core mask) Pair of integers which represent a region of a SpiNNaker machine and a core mask of selected cores within that region for use in flood-filling an application. `region` and `core_mask` are both integer representations of bit fields that are understood by SCAMP. The pairs are yielded in an order suitable for direct use with SCAMP's flood-fill core select (FFCS) method of loading. """

    t = RegionCoreTree()

    for (x, y), cores in iteritems(targets):
        for p in cores:
            t.add_core(x, y, p)

    return sorted(t.get_regions_and_coremasks())