Alice Margatroid (アリス·マーガトロイド) can control puppets. What's more, she can control her pupet to control other pupets.
The puppets she controls directly called the first-level puppet. And the puppets which are controlled by the first-level puppets are called the second-level puppet. So as the third, fourth and the ith-level.
One day she wants to do an experiment - reverse the relation between a controller and a controlled puppet.
but the rule is : one controlled poppet only can have one controller.
what you have to do is that tell Alice how to change the relation can she get the max-level puppet. (After reversal, Alice can be a puppet as well.)
Before reversal, the puppets controlled by Alice are the first level.
After reversal, the puppets controlled by the Chief puppet are the first level.
For each case, you should output the difference max-level between after and between reversal. Of cause, if the original state is the maximum, you can keep it without doing anyting.
You can change the relation between Alice and Grugru, then the max-level is 3.
You can either change the ralation between Alice and Blahblah, and change the ralation between Blahblah and
Peps, then the max-level is 3 too.
And in the original state, the max-level is 2.
So the difference is 1.