List sides of a rectangle

Hi! Is there any way that I can select clockwise rotating sides of a series of rectangles like in the screenshot? Thank you!

rectangulos.gh (19.6 KB)

shift2.gh (8.2 KB)