Most Frequent Number


Submit solution

Points: 10
Time limit: 2.0s
Memory limit: 256M

Author:
Problem types

Find the most frequent value in an integer sequence. If several values tie, choose the one that appears first in the sequence.

Input

The first line contains n (1 ≤ n ≤ 100000). The second line contains n integers |aᵢ| ≤ 10^9.

Output

Print the selected value followed by its frequency.

Examples

Input #1
5
2 1 1 2 3
Output #1
2 2
Input #2
5
3 1 3 1 2
Output #2
3 2


Comments

There are no comments at the moment.