Subordinates#11429

Subordinates

1 second
128 megabytes
Medium

Given the structure of a company, your task is to calculate for each employee the number of their subordinates.

Input

The first line has an integer n~(1 \le n \le 2 \cdot 10^5) — the number of employees. The employees are numbered , , ..., , and employee is the general director of the company.

After this, there are n − 1 integers: for each employee , , ... , their direct boss in the company.

Output

Print integers: for each employee , , ..., the number of their subordinates.

Examples

Example 1

Loading
Loading