Rikka with Employees

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Recently, Rikka became the boss of a big company. There are nn employees in Rikka's company, indexed from 11 to nn. Employee 11 is Rikka herself.

Each employee except Rikka has a direct supervisor. The direct supervisor of the ii-th employee is the p_ip\_i-th employee. The supervision relationship constitutes a tree. Employee uu is a subordinate of Employee vv if and only if vv is the direct supervisor or an indirect supervisor of uu.

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 ii and give the ii-th employee a holiday. This action can be taken only when ii 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 ii and interview him the feeling of being the boss. This action can be taken only when ii 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 9×1069 \times 10^6 days.

입력

The first line contains a single integer n (1n105)n\ (1 \leq n \leq 10^5), the number of employees.

The second line contains n1n-1 integers p_2,,p_n (1p_i<i)p\_2, \dots, p\_n\ (1 \leq p\_i < i), representing the direct supervisor of each employee.

출력

Output a single line with a single string. From left to right:

  • Substring "+xx" represents to give the xx-th employee a holiday;
  • Substring "-" represents to recall an employee;
  • Substring "=xx" represents to interview the xx-th employee.

Besides, Substring "!" represents that all actions are finished. Any characters after "!" will be ignored.

Your answer will be regarded as correct if and only if the following three conditions are satisfied:

  • The number of actions is no more than 9×1069 \times 10^6;
  • All actions are valid;
  • For each x\[1,n]x \in \[1,n], "=xx" is invoked exactly once.