Two groups of hierarchical selections in filter

Here is the case:

when [Hierarchy] value is 'A', a group of [a] selections displays in filter area. When user switch [Hierarchy] to ‘B’, all [a] selections are replaced by [b] selections.

Solution One below might lead to an inconsistent display of selections

Solution Two puts these two groups of selections in toggle dropdown, and requires two more clicks when user wants to come back and make selection changes at any level.

Need a second person's opinion here. Which solution is better? Are there any other suggestions?
Great Thanks.