#C13600. Frequency Counter

    ID: 43157 Type: Default 1000ms 256MiB

Frequency Counter

Frequency Counter

You are given a list of integers. Your task is to count the frequency of each unique integer in the list and output the results in ascending order of the integer.

For example, if the list is given as [5, 3, 5, 5, 2, 3, 3, 2], then the frequencies are: 2 appears twice, 3 appears three times, and 5 appears three times. The output should therefore be:

2 2
3 3
5 3

If the input list is empty, nothing should be printed.

Note: Input is read from standard input and output should be written to standard output.

inputFormat

The first line of the input contains an integer n which represents the number of elements in the list. The second line contains n space-separated integers.

outputFormat

Output each unique integer and its frequency in ascending order. Each line should contain the integer and its frequency separated by a single space.

## sample
8
5 3 5 5 2 3 3 2
2 2

3 3 5 3

</p>