Sort rectangle with width and height

I want to sort a lot of rectangles with their width and heights. For examples
their size are 53x30.599
53x19.506
78x45.033
78x76
and I want to have the result as shown on the following jpg

I can put the rectangles which widths are 53 and 78 into {0;0} and {0;1} respectively. But I do not know how to sort the rectangles with their heights inside {0;0} and {0;1}

Thanks


Sort rectangle with width and height.gh (12.9 KB)

But it’s not sorted ?

Sort rectangle with width and height_.gh (11.2 KB)

Hi Seghier
I can put that the rectangles with width 53 and 78 on {0;0} and {0;1} respectively.
But I cannot put the rectangles in {0;0} with height 30.599 and 19.506 on {0;0;0;x} and {0;0;1;x}

Thanks all, I can do what I want. Please see attached my new GH!


Uploading: Sort rectangle with width and height 3.gh…