import collections
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    S = [input() for _ in range(n)]
    word = collections.Counter(S).most_common()
    maxi = word[0][1]
    ans = []
    for w in word:
        if w[1] == maxi:
            ans.append(w[0])
        else:
            break
    ans.sort()
    a = "\n".join(ans)
    print(a)

if __name__ == '__main__':
    main() import collections collections import sys sys def I(): return int(sys.stdin.readline()) I def MI(): return map(int, sys.stdin.readline().split()) MI def LI(): return list(map(int, sys.stdin.readline().split())) LI def main():
    n = I()
    S = [input() for _ in range(n)]
    word = collections.Counter(S).most_common()
    maxi = word[0][1]
    ans = []
    for w in word:
        if w[1] == maxi:
            ans.append(w[0])
        else:
            break
    ans.sort()
    a = "\n".join(ans)
    print(a) main n = I() n I() I input() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) input() input S = [input() for _ in range(n)] S [input() for _ in range(n)] word = collections.Counter(S).most_common() word collections.Counter(S).most_common() collections.Counter(S).most_common collections.Counter(S) collections.Counter collections Counter S most_common maxi = word[0][1] maxi word[0][1] [0] word 0 1 ans = [] ans [] for w in word:
        if w[1] == maxi:
            ans.append(w[0])
        else:
            break
     w word if w[1] == maxi:
            ans.append(w[0])
        else:
            break
     w[1] == maxi w[1] w 1 maxi ans.append(w[0]) ans.append ans append w[0] w 0 break ans.sort() ans.sort ans sort a = "\n".join(ans) a "\n".join(ans) "\n".join "\n" join ans print(a) print a if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def MI(): return map(int, sys.stdin.readline().split()) def MI(): return map(int, sys.stdin.readline().split()) MI def LI(): return list(map(int, sys.stdin.readline().split())) def LI(): return list(map(int, sys.stdin.readline().split())) LI def main():
    n = I()
    S = [input() for _ in range(n)]
    word = collections.Counter(S).most_common()
    maxi = word[0][1]
    ans = []
    for w in word:
        if w[1] == maxi:
            ans.append(w[0])
        else:
            break
    ans.sort()
    a = "\n".join(ans)
    print(a) def main():
    n = I()
    S = [input() for _ in range(n)]
    word = collections.Counter(S).most_common()
    maxi = word[0][1]
    ans = []
    for w in word:
        if w[1] == maxi:
            ans.append(w[0])
        else:
            break
    ans.sort()
    a = "\n".join(ans)
    print(a) main def I(): return int(sys.stdin.readline()) def I(): return int(sys.stdin.readline()) I
import collections
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    S = [input() for _ in range(n)]
    word = collections.Counter(S).most_common()
    maxi = word[0][1]
    ans = []
    for w in word:
        if w[1] == maxi:
            ans.append(w[0])
        else:
            break
    ans.sort()
    a = "\n".join(ans)
    print(a)

if __name__ == '__main__':
    main()