#!/usr/bin/env python3
import collections as cl
import sys


def II():
    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 = II()

    counter = cl.Counter()
    for i in range(N):
        s = input()
        counter.update({s: 1})
    item, value = zip(*counter.most_common())
    ans = []
    max_num = value[0]
    for i in range(len(value)):
        if value[i] == max_num:
            ans.append(item[i])

    ans.sort()
    print(*ans, sep="\n")


main() import collections as cl collections import sys sys def II():
    return int(sys.stdin.readline()) II return int(sys.stdin.readline()) int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline def MI():
    return map(int, sys.stdin.readline().split()) MI return map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split def LI():
    return list(map(int, sys.stdin.readline().split())) LI return list(map(int, sys.stdin.readline().split())) list(map(int, sys.stdin.readline().split())) list map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split def main():
    N = II()

    counter = cl.Counter()
    for i in range(N):
        s = input()
        counter.update({s: 1})
    item, value = zip(*counter.most_common())
    ans = []
    max_num = value[0]
    for i in range(len(value)):
        if value[i] == max_num:
            ans.append(item[i])

    ans.sort()
    print(*ans, sep="\n") main N = II() N II() II counter = cl.Counter() counter cl.Counter() cl.Counter cl Counter for i in range(N):
        s = input()
        counter.update({s: 1})
     i range(N) range N s = input() s input() input counter.update({s: 1}) counter.update counter update {s: 1} s s 1 item, value = zip(*counter.most_common()) item zip(*counter.most_common()) zip *counter.most_common() counter.most_common() counter.most_common counter most_common value ans = [] ans [] max_num = value[0] max_num value[0] value 0 for i in range(len(value)):
        if value[i] == max_num:
            ans.append(item[i])

     i range(len(value)) range len(value) len value if value[i] == max_num:
            ans.append(item[i])

     value[i] == max_num value[i] value i max_num ans.append(item[i]) ans.append ans append item[i] item i ans.sort() ans.sort ans sort print(*ans, sep="\n") print *ans ans sep="\n" sep "\n" main() main def main():
    N = II()

    counter = cl.Counter()
    for i in range(N):
        s = input()
        counter.update({s: 1})
    item, value = zip(*counter.most_common())
    ans = []
    max_num = value[0]
    for i in range(len(value)):
        if value[i] == max_num:
            ans.append(item[i])

    ans.sort()
    print(*ans, sep="\n") def main():
    N = II()

    counter = cl.Counter()
    for i in range(N):
        s = input()
        counter.update({s: 1})
    item, value = zip(*counter.most_common())
    ans = []
    max_num = value[0]
    for i in range(len(value)):
        if value[i] == max_num:
            ans.append(item[i])

    ans.sort()
    print(*ans, sep="\n") main def II():
    return int(sys.stdin.readline()) def II():
    return int(sys.stdin.readline()) II def LI():
    return list(map(int, sys.stdin.readline().split())) def LI():
    return list(map(int, sys.stdin.readline().split())) LI def MI():
    return map(int, sys.stdin.readline().split()) def MI():
    return map(int, sys.stdin.readline().split()) MI
#!/usr/bin/env python3
import collections as cl
import sys


def II():
    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 = II()

    counter = cl.Counter()
    for i in range(N):
        s = input()
        counter.update({s: 1})
    item, value = zip(*counter.most_common())
    ans = []
    max_num = value[0]
    for i in range(len(value)):
        if value[i] == max_num:
            ans.append(item[i])

    ans.sort()
    print(*ans, sep="\n")


main()
