A juice shop recorded the flavour number of every glass sold today. The owner wants to know how many glasses of each flavour were sold.
Print each distinct value with its count, in the order the values first appeared.
Input Format
The first line has n.
The second line has n integers.
Output Format
For each distinct value (in first-appearance order), print a line: <value> <count>
Constraints
• 1 ≤ n ≤ 1000
• 1 ≤ value ≤ 10^9
Examples
Example 1
Input
7
3 1 3 2 1 3 5
Output
3 3
1 2
2 1
5 1
Explanation Flavour 3 sold 3 times, 1 twice, 2 once and 5 once.
Example 2
Explanation Only one flavour.
Example 3
Input
4
4 3 2 1
Output
4 1
3 1
2 1
1 1
Explanation All different, each sold once.
Acceptance
—
Accepted
0
Submissions
0