#K5226. Most Frequent Letter in Words

    ID: 29270 Type: Default 1000ms 256MiB

Most Frequent Letter in Words

Most Frequent Letter in Words

You are given a list of words consisting of lowercase letters. Your task is to determine the letter that appears most frequently among all the words. In case of a tie (i.e. several letters appear with the same maximal frequency), print the letter that comes first in alphabetical order.

Input Format: The input is read from standard input. The first line contains an integer n — the number of words. This is followed by n lines, each containing a single word composed solely of lowercase letters. If n is zero, no words follow.

Output Format: Print the single letter with the highest frequency. If there are no words (i.e. when n is zero), print an empty string.

Note: You may assume that all input words contain only lowercase English letters.

inputFormat

The input begins with an integer n indicating the number of words. The following n lines each contain one word made up of lowercase letters.

outputFormat

Output a single line containing the most frequent letter. If multiple letters share the same maximal frequency, output the one that comes first in alphabetical order. If no words are provided, output an empty string.

## sample
1
hello
l

</p>