import sys



def solve():

    N = int(eval(input()))

    word = dict()

    for i in range(N):

        s = eval(input())

        if s in word: word[s] += 1

        else: word[s] = 1



    L = []

    for key in word:

        L.append((word[key], key))

    L.sort(reverse = True)

    maxs = L[0][0]

    Ans = []

    for num, s in L:

        if num == maxs: Ans.append(s)

    Ans.sort()

    for a in Ans:

        print(a)



    return 0



if __name__ == "__main__":

    solve()
import sys

from collections import defaultdict



def solve():

    input = sys.stdin.readline

    N = int(input())

    sDict = defaultdict(int)

    maxCount = 0

    for i in range(N):

        s = input().strip("\n")

        sDict[s] += 1

        maxCount = max(maxCount, sDict[s])

    maxS = []

    for key in sDict:

        if sDict[key] == maxCount:

            maxS.append(key)

    maxS.sort()

    print(*maxS, sep="\n")



    return 0



if __name__ == "__main__":

    solve()

import sys


def solve():
    N = int(eval(input()))
    word = dict()
    for i in range(N):
        s = eval(input())
        if s in word:
            word[s] += 1
        else:
            word[s] = 1
    L = []
    for key in word:
        L.append((word[key], key))
    L.sort(reverse=True)
    maxs = L[0][0]
    Ans = []
    for num, s in L:
        if num == maxs:
            Ans.append(s)
    Ans.sort()
    for a in Ans:
        print(a)
    return 0


if __name__ == "__main__":
    solve()

import sys
from collections import defaultdict


def solve():
    input = sys.stdin.readline
    N = int(input())
    sDict = defaultdict(int)
    maxCount = 0
    for i in range(N):
        s = input().strip("\n")
        sDict[s] += 1
        maxCount = max(maxCount, sDict[s])
    maxS = []
    for key in sDict:
        if sDict[key] == maxCount:
            maxS.append(key)
    maxS.sort()
    print(*maxS, sep="\n")
    return 0


if __name__ == "__main__":
    solve()

+from collections import defaultdict -    N = int(eval(input())) -    word = dict() +    input = sys.stdin.readline +    N = int(input()) +    sDict = defaultdict(int) +    maxCount = 0 -        s = eval(input()) -        if s in word: -            word[s] += 1 -        else: -            word[s] = 1 -    L = [] -    for key in word: -        L.append((word[key], key)) -    L.sort(reverse=True) -    maxs = L[0][0] -    Ans = [] -    for num, s in L: -        if num == maxs: -            Ans.append(s) -    Ans.sort() -    for a in Ans: -        print(a) +        s = input().strip("\n") +        sDict[s] += 1 +        maxCount = max(maxCount, sDict[s]) +    maxS = [] +    for key in sDict: +        if sDict[key] == maxCount: +            maxS.append(key) +    maxS.sort() +    print(*maxS, sep="\n")