Term frequency–Inverse document frequency (tf-idf) is a numerical statistic that reflects the importance of a word in a collection of documents. It is often used in information retrieval systems. The number of times a word appears in a document (word frequency) is one of the main factors for calculating tf-idf.
You are to write a program to find the most frequent word in a document.
The first line contains an integer n~(1 \le n \le 1000), the number of words. The following lines contain the words, one per line. Each word consists only of lowercase Latin letters and is at most characters long.
Print the word with the highest frequency, followed by its frequency, separated by a space. If multiple words have the same highest frequency, output the one that comes last in lexicographical order.
Example 1