#t114. 词频统计

词频统计

Word Frequency Counting

Problem Description

In text processing, counting how often words appear is a common task. Given nn words, find the one that appears most frequently. Letter case is ignored here (i.e. Apple, apple, APPLE, aPPle all count as the same word).

Write a program that reads nn words and outputs the most frequent word.

Input Format

The first line contains an integer nn, the number of words.

The next nn lines each contain one word, consisting of uppercase and lowercase English letters.

It is guaranteed that exactly one word is the most frequent.

Output Format

Output one line containing the most frequent word (output in lowercase).

Sample Input

6
Apple
banana
apple
Orange
banana
apple

Sample Output

apple

Sample Explanation

In the sample there are 66 words. Ignoring case, Apple becomes apple, banana becomes banana, apple becomes apple, Orange becomes orange, banana becomes banana, apple becomes apple. Counting occurrences: apple appears 33 times, banana 22 times, orange 11 time. The most frequent word is apple, so the program outputs its lowercase form apple.

Constraints

For all test data, 1≤n≤1001 \le n \le 100, each word has length at most 3030, and consists only of uppercase and lowercase letters.