- Time limit: 1.00 s
- Memory limit: 512 MB
Given the structure of a company, your task is to calculate for each employee the number of their subordinates.
Input
The first input line has an integer : the number of employees. The employees are numbered , and employee is the general director of the company.
After this, there are integers: for each employee their direct boss in the company.
Output
Print integers: for each employee the number of their subordinates.
Constraints
Example
Input:
5 1 1 2 3
Output:
4 1 1 0 0