Write a program that finds the most frequent word for every given sequence of words.
Input consists of several cases. Every case begins with a number between 1 and , followed by words made up of only lowercase letters. A special case with marks the end of input.
For every case, print the word that appears more times. If there is a tie, print the largest word in alphabetical order.
Input
6 joan maria maria anna maria joan 2 aaa b 0
Output
maria b