Cards
InterviewTime limit1sMemory limit256 MB
Count the N card values and print the most frequent one, breaking ties by the smaller value.
Problem
Jungyu has number cards. Each card has one integer written on it, and that integer is at least and at most .
Given the cards Jungyu holds, write a program that finds the integer he holds the most copies of. If several integers are tied for the largest count, print the smallest of them.
Input
The first line contains the number of cards (). Each of the next lines contains one integer written on a card.
Output
Print the integer that Jungyu holds the most copies of.