How to extract Curves from Surface

I have a surface with holes. How can I Extract that surface to One Outer Close Curve and other Inner Close Curve per Hole.
Thank for any help.

Without any plugins, the easiest (but not best) I can think of
Brep Edges -> Join Curves -> Length -> Sort
the longest curve would be the outer curve “most” of the time, but no always, depends on the geometry
another idea is Shape in Brep, extrude all the edges and check which one contains everything else, performance-wise probably not great.