Fashion Elements 4#8976

Fashion Elements 4

1 second
64 megabytes
Very easy

In a given array of integers, find the elements that occur most frequently. First, determine the highest frequency for any element in the array. Then, output all elements that have this maximum frequency. The order of output should correspond to the order in which each element first reaches this frequency in the input.

Input

The first line contains an integer (1 \leq N \leq 1000), the number of elements in the array.

The second line contains integers. Each integer's absolute value does not exceed .

Output

On the first line, output the maximum frequency of any element.

On the second line, output all elements that occur with this maximum frequency in the order described above.

Examples

Example 1

Loading
Loading