#C10769. Election Winner Determination
Election Winner Determination
Election Winner Determination
You are given an election scenario where there are n votes. Each vote is a string that represents the name of a candidate. Your task is to determine the winner of the election. The winner is the candidate who has received the highest number of votes. In case of a tie, the candidate with the lexicographically smallest name (i.e., the one that comes first in alphabetical order) wins.
Note: The input first contains an integer n followed by n lines each containing a vote (a candidate's name). The output is a single line showing the winning candidate's name.
Mathematically, let \( f(x) \) denote the number of votes candidate \( x \) received. We need to find candidate \( x^* \) such that \[ x^* = \min \{ x \; | \; f(x) = \max_{y} f(y) \}. \]
inputFormat
The input is read from stdin and has the following format:
The first line contains an integer n (number of votes). The next n lines each contain a string representing a candidate's name.
outputFormat
Print the name of the winning candidate to stdout. There is no extra output.
## sample1
alice
alice
</p>