Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

EI20213Q2B - Frequency of Numbers (2)

Given a list of integers, output the list of distinct values and the corresponding number of their occurrences. Output list must be ordered by the occurrences in descending, and value in ascending. 

Input

  • The first line contains one integer N - the number of integers (1 ≤ N ≤ 105).

  • The next line contains N integers which do not exceed 109.

Output

Each line contains a value and the number of occurrences of the value.

Sample

Input

Output

8

0 4 3 1 5 6 1 3

1 2

3 2

0 1

4 1

5 1

6 1 


Added by:Ha Minh Ngoc
Date:2021-07-10
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:CSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG FSHARP GO JAVA JS-MONKEY NODEJS PHP PYTHON PYPY PYPY3 PYTHON3 RUBY SQLITE SWIFT VB.NET
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.