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
I want to combine A and B and rename it in order, without touching C and D

basically from


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

Never mind figured out stack tree works