IITKESO207PA4Q2 - Favourite Word
After finally becoming friends, Mahesh and Nitish now talk frequently with each other. While talking to Mahesh, Nitish notices that he uses a certain word more than others. Therefore, Nitish decides to carry out his own experiment. Nitish has given you a part of Mahesh's speech (a set of words used by Mahesh) and has asked you to find out Mahesh's favourite word. We define Mahesh's favourite word as the word he uses most. You are guaranteed that there is a unique favourite word. Mahesh speaks a weird language in which a word is simply a string of lowercase characters. You are given that no word is more than 100 characters long.
The first line of input is an integer n which denotes the total number of words spoken by Mahesh. (n <= 100000)
The following n lines contain the words.
In each case, output Mahesh's favourite word.
mvhwh Output: mvhwh
Programming Club, IITK:
wisfaq: Fixed. Thanks. :)
In the example there are 10 words, not 9.