#K71777. Tournament Winner Determination

    ID: 33607 Type: Default 1000ms 256MiB

Tournament Winner Determination

Tournament Winner Determination

In this problem, you are given an integer n representing the number of rounds in a tournament, followed by n winner names corresponding to each round. Your task is to determine the overall winner of the tournament. The overall winner is the player with the maximum number of wins, i.e. the maximum value of wins, $$\max\{c_i\}$$, where \(c_i\) is the number of wins obtained by the i-th player. In case more than one player achieves this maximum, output all such winners in alphabetical (lexicographical) order, separated by a single space.

Note: Input will be provided via standard input (stdin) and the output should be printed to standard output (stdout).

inputFormat

The first line contains an integer n (\(1 \leq n \leq 10^5\)) representing the number of rounds in the tournament.

The second line contains n space-separated strings, each denoting the winner of a particular round.

outputFormat

Output a single line containing the name(s) of the overall tournament winner(s). If there are multiple winners, list them in alphabetical order separated by a single space.

## sample
5
alice bob alice alice bob
alice

</p>