Imprint overlapping polygons

Hey everyone,

I've been having a hard time trieing to wrap my mind around this problem:

I have a couple of Z-planar polygons that overlap/intersect each other and I need to imprint the smaller polygons onto the larger if they intersect/cut the smaller polygon out of the larger polygon.

These polygons are part of a larger stack of "slices" taken out of a mesh:

so whatever the solution is it has to work without disturbing the other slices in the stack.

I don't really know where to even start with this and I'd greatly appreciate any help!

Thank you for your time.