5321: ABC163——Task C:management
Description
A company has NN members, who are assigned ID numbers 1,...,N1,...,N.
Every member, except the member numbered 11, has exactly one immediate boss with a smaller ID number.
When a person XX is the immediate boss of a person YY, the person YY is said to be an immediate subordinate of the person XX.
You are given the information that the immediate boss of the member numbered ii is the member numbered AiAi. For each member, find how many immediate subordinates it has.
Input
N A2 ... AN
Output
Constraints
- 2≤N≤2×1052≤N≤2×105
- 1≤Ai<i1≤Ai<i
Sample 1 Input
5
1 1 2 2
Sample 1 Output
2
2
0
0
0
The member numbered 11 has two immediate subordinates: the members numbered 22 and 33.
The member numbered 22 has two immediate subordinates: the members numbered 44 and 55.
The members numbered 33, 44, and 55 do not have immediate subordinates.
Sample 2 Input
10
1 1 1 1 1 1 1 1 1
Sample 2 Output
9
0
0
0
0
0
0
0
0
0
Sample 3 Input
7
1 2 3 4 5 6
Sample 3 Output
1
1
1
1
1
1
0