import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from  collections import defaultdict
from collections import Counter
def main():
    N = I()
    s_list = []
    for i in range(N):
        s = S()
        s_list.append(s)
    c = Counter(s_list)
    a = max(c.values())
    ans_list = []
    for key in c.keys():
        if c[key] == a:
            ans_list.append(key)
    ans_list.sort()
    for ans in ans_list:
        print(ans)



if __name__ == "__main__":
    main() import bisect, collections, copy, heapq, itertools, math, string bisect collections copy heapq itertools math string import sys sys def I(): return int(sys.stdin.readline().rstrip()) I def MI(): return map(int, sys.stdin.readline().rstrip().split()) MI def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) LI def S(): return sys.stdin.readline().rstrip() S def LS(): return list(sys.stdin.readline().rstrip().split()) LS from  collections import defaultdict from collections import Counter def main():
    N = I()
    s_list = []
    for i in range(N):
        s = S()
        s_list.append(s)
    c = Counter(s_list)
    a = max(c.values())
    ans_list = []
    for key in c.keys():
        if c[key] == a:
            ans_list.append(key)
    ans_list.sort()
    for ans in ans_list:
        print(ans) main N = I() N I() I s_list = [] s_list [] for i in range(N):
        s = S()
        s_list.append(s)
     i range(N) range N s = S() s S() S s_list.append(s) s_list.append s_list append s c = Counter(s_list) c Counter(s_list) Counter s_list a = max(c.values()) a max(c.values()) max c.values() c.values c values ans_list = [] ans_list [] for key in c.keys():
        if c[key] == a:
            ans_list.append(key)
     key c.keys() c.keys c keys if c[key] == a:
            ans_list.append(key)
     c[key] == a c[key] c key a ans_list.append(key) ans_list.append ans_list append key ans_list.sort() ans_list.sort ans_list sort for ans in ans_list:
        print(ans) ans ans_list print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def I(): return int(sys.stdin.readline().rstrip()) def I(): return int(sys.stdin.readline().rstrip()) I def LS(): return list(sys.stdin.readline().rstrip().split()) def LS(): return list(sys.stdin.readline().rstrip().split()) LS def MI(): return map(int, sys.stdin.readline().rstrip().split()) def MI(): return map(int, sys.stdin.readline().rstrip().split()) MI def S(): return sys.stdin.readline().rstrip() def S(): return sys.stdin.readline().rstrip() S def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) LI def main():
    N = I()
    s_list = []
    for i in range(N):
        s = S()
        s_list.append(s)
    c = Counter(s_list)
    a = max(c.values())
    ans_list = []
    for key in c.keys():
        if c[key] == a:
            ans_list.append(key)
    ans_list.sort()
    for ans in ans_list:
        print(ans) def main():
    N = I()
    s_list = []
    for i in range(N):
        s = S()
        s_list.append(s)
    c = Counter(s_list)
    a = max(c.values())
    ans_list = []
    for key in c.keys():
        if c[key] == a:
            ans_list.append(key)
    ans_list.sort()
    for ans in ans_list:
        print(ans) main
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from  collections import defaultdict
from collections import Counter
def main():
    N = I()
    s_list = []
    for i in range(N):
        s = S()
        s_list.append(s)
    c = Counter(s_list)
    a = max(c.values())
    ans_list = []
    for key in c.keys():
        if c[key] == a:
            ans_list.append(key)
    ans_list.sort()
    for ans in ans_list:
        print(ans)



if __name__ == "__main__":
    main()
