from collections import Counter

def solve():
    N = int(input())
    c = Counter([input() for _ in range(N)])
    cnt = -1
    ans = []
    for i in c.most_common():
        if cnt == -1:
            cnt = i[1]
            ans.append(i[0])
        elif cnt == i[1]:
            ans.append(i[0])
        else:
            break
    for a in sorted(ans):
        print(a)
    
if __name__ == "__main__":
    solve() from collections import Counter def solve():
    N = int(input())
    c = Counter([input() for _ in range(N)])
    cnt = -1
    ans = []
    for i in c.most_common():
        if cnt == -1:
            cnt = i[1]
            ans.append(i[0])
        elif cnt == i[1]:
            ans.append(i[0])
        else:
            break
    for a in sorted(ans):
        print(a)
     solve N = int(input()) N int(input()) int input() input input() for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) input() input c = Counter([input() for _ in range(N)]) c Counter([input() for _ in range(N)]) Counter [input() for _ in range(N)] cnt = -1 cnt -1 ans = [] ans [] for i in c.most_common():
        if cnt == -1:
            cnt = i[1]
            ans.append(i[0])
        elif cnt == i[1]:
            ans.append(i[0])
        else:
            break
     i c.most_common() c.most_common c most_common if cnt == -1:
            cnt = i[1]
            ans.append(i[0])
        elif cnt == i[1]:
            ans.append(i[0])
        else:
            break
     cnt == -1 cnt -1 cnt = i[1] cnt i[1] i 1 ans.append(i[0]) ans.append ans append i[0] i 0 elif cnt == i[1]:
            ans.append(i[0])
         cnt == i[1] cnt i[1] i 1 ans.append(i[0]) ans.append ans append i[0] i 0 break for a in sorted(ans):
        print(a)
     a sorted(ans) sorted ans print(a) print a if __name__ == "__main__":
    solve() __name__ == "__main__" __name__ "__main__" solve() solve def solve():
    N = int(input())
    c = Counter([input() for _ in range(N)])
    cnt = -1
    ans = []
    for i in c.most_common():
        if cnt == -1:
            cnt = i[1]
            ans.append(i[0])
        elif cnt == i[1]:
            ans.append(i[0])
        else:
            break
    for a in sorted(ans):
        print(a)
     def solve():
    N = int(input())
    c = Counter([input() for _ in range(N)])
    cnt = -1
    ans = []
    for i in c.most_common():
        if cnt == -1:
            cnt = i[1]
            ans.append(i[0])
        elif cnt == i[1]:
            ans.append(i[0])
        else:
            break
    for a in sorted(ans):
        print(a)
     solve
from collections import Counter

def solve():
    N = int(input())
    c = Counter([input() for _ in range(N)])
    cnt = -1
    ans = []
    for i in c.most_common():
        if cnt == -1:
            cnt = i[1]
            ans.append(i[0])
        elif cnt == i[1]:
            ans.append(i[0])
        else:
            break
    for a in sorted(ans):
        print(a)
    
if __name__ == "__main__":
    solve()