Sorting floating lines (end of next line has same x and y value as start from line next to it)

i have a bunch of lines. atm they are randomly sorted. i would like to get them sorted in one continous motion :slight_smile:

like this:

i tried projecting the lines on the floor and seeing what end goes with what start. but I don’t know how to procede from here :confused:

any tips?

sort floating (9.0 KB) (6.4 KB)

thanks :sunny: