Merge innermost branches with Path Mapper

I am trying to merge the innermost branches in a tree with the following structure: {A;B} Total of X+Y+Z=W branches
{0} X branches
{1} Y branches
{2} Z branches


I want to keep the same total number of branches (W), i.e. append all the branches in {1} after the last branches in {0}.
However, with {A;B} > {B} I get the number of branches in the most populous innermost branch (X) instead, and data from the other branches ({1}, {2}) added to the corresponding branches of the first branch ({0}).
How should I fix the expression?

not sure this is what you’re looking for… keep the very same data structure but just rename all the paths progressively?

That’s it, exactly. Thank you!