import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools

def main():
    n = int(input())
    dic = {}
    for i in range(n):
        k = input().rstrip()
        dic[k] = dic.get(k,0) + 1

    m = max(list(dic.values()))
    ans = []
    for i,k in dic.items():
        if k == m:
            ans.append(i)
    print("\n".join(sorted(ans)))




if __name__=="__main__":
    main() import math math from math import gcd INF = float("inf") INF float("inf") float "inf" import sys sys input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline import itertools itertools def main():
    n = int(input())
    dic = {}
    for i in range(n):
        k = input().rstrip()
        dic[k] = dic.get(k,0) + 1

    m = max(list(dic.values()))
    ans = []
    for i,k in dic.items():
        if k == m:
            ans.append(i)
    print("\n".join(sorted(ans))) main n = int(input()) n int(input()) int input() input dic = {} dic {} for i in range(n):
        k = input().rstrip()
        dic[k] = dic.get(k,0) + 1

     i range(n) range n k = input().rstrip() k input().rstrip() ().rstrip () input rstrip dic[k] = dic.get(k,0) + 1 dic[k] dic k dic.get(k,0) + 1 dic.get(k,0) dic.get dic get k 0 1 m = max(list(dic.values())) m max(list(dic.values())) max list(dic.values()) list dic.values() dic.values dic values ans = [] ans [] for i,k in dic.items():
        if k == m:
            ans.append(i)
     i k dic.items() dic.items dic items if k == m:
            ans.append(i)
     k == m k m ans.append(i) ans.append ans append i print("\n".join(sorted(ans))) print "\n".join(sorted(ans)) "\n".join "\n" join sorted(ans) sorted ans if __name__=="__main__":
    main() __name__=="__main__" __name__ "__main__" main() main def main():
    n = int(input())
    dic = {}
    for i in range(n):
        k = input().rstrip()
        dic[k] = dic.get(k,0) + 1

    m = max(list(dic.values()))
    ans = []
    for i,k in dic.items():
        if k == m:
            ans.append(i)
    print("\n".join(sorted(ans))) def main():
    n = int(input())
    dic = {}
    for i in range(n):
        k = input().rstrip()
        dic[k] = dic.get(k,0) + 1

    m = max(list(dic.values()))
    ans = []
    for i,k in dic.items():
        if k == m:
            ans.append(i)
    print("\n".join(sorted(ans))) main input=sys.stdin.readline sys.stdin.readline input INF = float("inf") float("inf") INF
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools

def main():
    n = int(input())
    dic = {}
    for i in range(n):
        k = input().rstrip()
        dic[k] = dic.get(k,0) + 1

    m = max(list(dic.values()))
    ans = []
    for i,k in dic.items():
        if k == m:
            ans.append(i)
    print("\n".join(sorted(ans)))




if __name__=="__main__":
    main()
