#C12276. Find the Most Frequent Element

    ID: 41685 Type: Default 1000ms 256MiB

Find the Most Frequent Element

Find the Most Frequent Element

You are given a list of integers. Your task is to find the integer that appears most frequently in the list.

If there is a tie (i.e. multiple integers have the same highest frequency), you may output any one of them.

Note: The input will be given via standard input and the output should be written to standard output.

Mathematically, if the frequency function is defined as \( f(x) \) for an element \( x \) in the list, then you need to find an integer \( m \) such that \[ m = \arg\max_{x} f(x), \] where in case of a tie any valid \( m \) is acceptable.

inputFormat

The first line of the input contains an integer \( n \) denoting the number of elements in the list. The second line contains \( n \) integers separated by spaces.

outputFormat

Output a single integer which is the most frequent element in the list. If there are multiple answers, any one is acceptable.

## sample
1
1
1

</p>