def main():

    dic = {}

    n = int(eval(input()))

    for i in range(n):

        s = input().rstrip()

        if s in list(dic.keys()):

            dic[s] += 1

        else:

            dic[s] =  1

    m = 0

    for v in list(dic.values()):

        if m < v:

            m = v

    s_dic = sorted(list(dic.items()), key=lambda x:x[0])

    for k, v in s_dic:

        if v == m:

            print(k)



if __name__ == "__main__":

    main()
def main():

    dic = {}

    n = int(eval(input()))

    for _ in range(n):

        s = input().rstrip()

        if s in list(dic.keys()):

            dic[s] += 1

        else:

            dic[s] =  1

    m = max(dic.values())

    ans = [key for key, val in list(dic.items()) if val == m]

    for a in sorted(ans):

        print(a)



if __name__ == "__main__":

    main()
def main():
    dic = {}
    n = int(eval(input()))
    for i in range(n):
        s = input().rstrip()
        if s in list(dic.keys()):
            dic[s] += 1
        else:
            dic[s] = 1
    m = 0
    for v in list(dic.values()):
        if m < v:
            m = v
    s_dic = sorted(list(dic.items()), key=lambda x: x[0])
    for k, v in s_dic:
        if v == m:
            print(k)


if __name__ == "__main__":
    main()

def main():
    dic = {}
    n = int(eval(input()))
    for _ in range(n):
        s = input().rstrip()
        if s in list(dic.keys()):
            dic[s] += 1
        else:
            dic[s] = 1
    m = max(dic.values())
    ans = [key for key, val in list(dic.items()) if val == m]
    for a in sorted(ans):
        print(a)


if __name__ == "__main__":
    main()

-    for i in range(n): +    for _ in range(n): -    m = 0 -    for v in list(dic.values()): -        if m < v: -            m = v -    s_dic = sorted(list(dic.items()), key=lambda x: x[0]) -    for k, v in s_dic: -        if v == m: -            print(k) +    m = max(dic.values()) +    ans = [key for key, val in list(dic.items()) if val == m] +    for a in sorted(ans): +        print(a)