def solve():
    N = int(input())
    word_count = {}
    max_count = 0
    for i in range(N):
        word = input()
        word_count[word] = word_count.get(word, 0) + 1
        max_count = max(word_count[word], max_count)
    ans_words = []
    for w,c in word_count.items():
        if c == max_count:
            ans_words.append(w)
    print('\n'.join(sorted(ans_words)))

if __name__ == "__main__":
    solve() def solve():
    N = int(input())
    word_count = {}
    max_count = 0
    for i in range(N):
        word = input()
        word_count[word] = word_count.get(word, 0) + 1
        max_count = max(word_count[word], max_count)
    ans_words = []
    for w,c in word_count.items():
        if c == max_count:
            ans_words.append(w)
    print('\n'.join(sorted(ans_words))) solve N = int(input()) N int(input()) int input() input word_count = {} word_count {} max_count = 0 max_count 0 for i in range(N):
        word = input()
        word_count[word] = word_count.get(word, 0) + 1
        max_count = max(word_count[word], max_count)
     i range(N) range N word = input() word input() input word_count[word] = word_count.get(word, 0) + 1 word_count[word] word_count word word_count.get(word, 0) + 1 word_count.get(word, 0) word_count.get word_count get word 0 1 max_count = max(word_count[word], max_count) max_count max(word_count[word], max_count) max word_count[word] word_count word max_count ans_words = [] ans_words [] for w,c in word_count.items():
        if c == max_count:
            ans_words.append(w)
     w c word_count.items() word_count.items word_count items if c == max_count:
            ans_words.append(w)
     c == max_count c max_count ans_words.append(w) ans_words.append ans_words append w print('\n'.join(sorted(ans_words))) print '\n'.join(sorted(ans_words)) '\n'.join '\n' join sorted(ans_words) sorted ans_words if __name__ == "__main__":
    solve() __name__ == "__main__" __name__ "__main__" solve() solve def solve():
    N = int(input())
    word_count = {}
    max_count = 0
    for i in range(N):
        word = input()
        word_count[word] = word_count.get(word, 0) + 1
        max_count = max(word_count[word], max_count)
    ans_words = []
    for w,c in word_count.items():
        if c == max_count:
            ans_words.append(w)
    print('\n'.join(sorted(ans_words))) def solve():
    N = int(input())
    word_count = {}
    max_count = 0
    for i in range(N):
        word = input()
        word_count[word] = word_count.get(word, 0) + 1
        max_count = max(word_count[word], max_count)
    ans_words = []
    for w,c in word_count.items():
        if c == max_count:
            ans_words.append(w)
    print('\n'.join(sorted(ans_words))) solve
def solve():
    N = int(input())
    word_count = {}
    max_count = 0
    for i in range(N):
        word = input()
        word_count[word] = word_count.get(word, 0) + 1
        max_count = max(word_count[word], max_count)
    ans_words = []
    for w,c in word_count.items():
        if c == max_count:
            ans_words.append(w)
    print('\n'.join(sorted(ans_words)))

if __name__ == "__main__":
    solve()