I think I found a working example where we can specify the depth of this. https://www.examplefiles.net/cs/25063 this explains the concept and will take you to this playground link

In theory we can have tree-like structures as long as we set a limit. Now… the problem? You guessed it, it generates a shitload of combinations and how do we define this limit?

I’ll keep this in background and once I compute a solution will leave comm here.