시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB25320419281.356%

문제

Term frequency–Inverse document frequency (tf-idf) is a numerical statistic which reflects the importance of words in a document collection. It is often used in information retrieval system. The number of times a word appears in the document (word frequency) is one of the major factors to acquire tf-idf. 

You are asked to write a program to find the most frequent word in a document. 

입력

The first line contains an integer n (1≤ n ≤ 1000) which determines the number of words. The following n lines include the list of words, one word per line. A word contains only lower-case letters and it can contain up to 20 characters. 

출력

Print out the word that has the highest frequency and its frequency, separated by a single space. If you get more than 2 results, choose only the one that comes later in the lexicographical order. 

예제 입력 1

10
mountain
lake
lake
zebra
tree
lake
zebra
zebra
animal
lakes

예제 출력 1

zebra 3