Recently, Rikka became the boss of a big company. There are n employees in Rikka's company, indexed from 1 to n. Employee 1 is Rikka herself.
Each employee except Rikka has a direct supervisor. The direct supervisor of the i-th employee is the

-th employee. The supervision relationship constitutes a tree. Employee u is a subordinate of Employee v if and only if v is the direct supervisor or an indirect supervisor of u.
To encourage employees, Rikka decides to let each employee experience the feeling of being the boss. To achieve this, Rikka will give some employees a holiday. For an employee, he/she will feel like the boss only when the following three conditions are satisfied:
- He/she is at work;
- All his/her subordinates are at work;
- All employees except he/she and his/her subordinates are on holiday.
Now, Rikka is going to make a plan. In the beginning, all employees are at work. In each day, Rikka can make one of the following actions:
- Choose an index i and give the i-th employee a holiday. This action can be taken only when i is on work;
- Recall an employee which is on holiday. If there are multiple employees which are on holiday, the employee with the shortest holiday will be back. Since the longer the holiday is, the farther the employee will be from the company, and thus the harder recalling he/she will be. Note that this action can be taken only when there is at least one on-holiday employee;
- Choose an index i and interview him the feeling of being the boss. This action can be taken only when i is feeling like the boss at this time.
Rikka wants you to make a plan. Since it is expensive to give employees holidays, you are required to make every employee feel like the boss and interview them within

days.