How to divide objects in groups


I’m trying to divide a series of modules (rectangular boxes) into 3 random groups, where each of them is composed, respectively, of 1 box, 3 boxes and 5 boxes. Every group can aggregate randomly, e.g. the 3 boxes can be one on top of the other, stack horizontally or two on the bottom and one on top.
Is this possible without using any coding, but just with the functions in Grasshopper?

I’d like to do this for the space now occupied by the orange and white boxes in my file, to create a facade of apartments composed of 3 and 5 modules and have a few of the single modules as well. (26.2 KB)

Thanks so much for your help!