Grouping curves that have different z coordinations into branches

The image is useless to Grasshopper.

3. Attach minimal versions of all the relevant files

P.S. Member Index can be extremely useful for this problem.