#C12722. Count Occurrences

    ID: 42181 Type: Default 1000ms 256MiB

Count Occurrences

Count Occurrences

Given a list of integers, your task is to count the number of occurrences of each integer. For each unique integer, output the integer followed by its frequency. The results should be displayed in increasing order of the integers.

For example, if the input is the list [4, 5, 7, 4, 2, 7, 4, 5, 6, 7], the output should be:

2 1
4 3
5 2
6 1
7 3

Solve this problem by reading from standard input and writing the answer to standard output.

inputFormat

The first line contains a single integer n which represents the number of integers in the list.

The second line contains n space-separated integers. If n is 0, the list is empty.

outputFormat

For each unique integer in the list, print a line containing the integer and its count separated by a space. The output should be sorted in increasing order of the integers.

## sample
3
1 2 3
1 1

2 1 3 1

</p>