Trim Extrusion/Polysurfaces so they no longer intersect

Hello everybody.

I have a set of solids like in the picture below and need to trim them so that they no longer intersect, but not only that, The trim has to be uniform by a perpendicular plane.

I have many of these intersections about 50 with multiple solids each. Is there a way to do this automatically instead of selecting and trimming manually?

Thanks for the help.

Intersection

Wrong Result

Desired Result