Merge sub-path of a data tree and rename them

Hi I want to do a fairly simple merge tree branch and rename but the tree has a few layers so I can’t figure it out, for example, a tree with a structure
{A;B;C}(D)
I want to combine A and B and rename it in order, without touching C and D

basically from
{0;0;0}(n=2)
{0;0;1}(n=2)
{0;1;0}(n=2)
{0;2;0}(n=2)
{1;0;0}(n=2)
{1;1;0}(n=2)
{1;1;1}(n=2)
{1;1;2}(n=2)

into
{0;0}(n=2)
{1;1}(n=2)
{2;0}(n=2)
{3;0}(n=2)
{4;0}(n=2)
{5;0}(n=2)
{6;1}(n=2)
{7;2}(n=2)

I tried many things with treesloth as well but can’t figure out. Thanks

Never mind figured out stack tree works