Subordinates
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
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 — 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.
Examples
Input #1
Answer #1
Submissions 123
Acceptance rate 49%