#abc231b. B - Election

B - Election

Score : 200200 points

问题陈述

一场选举正在进行中。

NN个人参与了投票。第 ii 个投票者 (1iN)(1 \leq i \leq N) 投给了名为 SiS_i 的候选人。

找出获得最多票数的候选人的名字。给定的输入保证了存在一个获得最多票数的独特候选人。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

An election is taking place.

NN people voted. The ii-th person (1iN)(1 \leq i \leq N) cast a vote to the candidate named SiS_i.

Find the name of the candidate who received the most votes. The given input guarantees that there is a unique candidate with the most votes.

Constraints

  • 1N1001 \leq N \leq 100
  • SiS_i is a string of length between 11 and 1010 (inclusive) consisting of lowercase English letters.
  • NN is an integer.
  • There is a unique candidate with the most votes.

Input

Input is given from Standard Input in the following format:

NN

S1S_1

S2S_2

\vdots

SNS_N

Output

Print the name of the candidate who received the most votes.

Sample Input 1

5
snuke
snuke
takahashi
takahashi
takahashi

Sample Output 1

takahashi

takahashi got 33 votes, and snuke got 22, so we print takahashi.

Sample Input 2

5
takahashi
takahashi
aoki
takahashi
snuke

Sample Output 2

takahashi

Sample Input 3

1
a

Sample Output 3

a

update @ 2024/3/10 10:04:35