import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from collections import Counter

    N = int(readline())
    c = Counter()

    for _ in range(N):
        s = input()
        c[s] += 1

    _, cnt = c.most_common(1)[0]

    res = []
    for key, val in c.items():
        if val == cnt:
            res.append(key)

    res.sort()

    for x in res:
        print(x)


if __name__ == '__main__':
    main() import sys sys readline = sys.stdin.readline readline sys.stdin.readline sys.stdin sys stdin readline MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 INF = float('INF') INF float('INF') float 'INF' sys.setrecursionlimit(10 ** 5) sys.setrecursionlimit sys setrecursionlimit 10 ** 5 10 5 def main():
    from collections import Counter

    N = int(readline())
    c = Counter()

    for _ in range(N):
        s = input()
        c[s] += 1

    _, cnt = c.most_common(1)[0]

    res = []
    for key, val in c.items():
        if val == cnt:
            res.append(key)

    res.sort()

    for x in res:
        print(x) main from collections import Counter N = int(readline()) N int(readline()) int readline() readline c = Counter() c Counter() Counter for _ in range(N):
        s = input()
        c[s] += 1

     _ range(N) range N s = input() s input() input c[s] += 1 c[s] c s 1 _, cnt = c.most_common(1)[0] _ c.most_common(1)[0] c.most_common(1) c.most_common c most_common 1 0 cnt res = [] res [] for key, val in c.items():
        if val == cnt:
            res.append(key)

     key val c.items() c.items c items if val == cnt:
            res.append(key)

     val == cnt val cnt res.append(key) res.append res append key res.sort() res.sort res sort for x in res:
        print(x) x res print(x) print x if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main readline = sys.stdin.readline sys.stdin.readline readline INF = float('INF') float('INF') INF def main():
    from collections import Counter

    N = int(readline())
    c = Counter()

    for _ in range(N):
        s = input()
        c[s] += 1

    _, cnt = c.most_common(1)[0]

    res = []
    for key, val in c.items():
        if val == cnt:
            res.append(key)

    res.sort()

    for x in res:
        print(x) def main():
    from collections import Counter

    N = int(readline())
    c = Counter()

    for _ in range(N):
        s = input()
        c[s] += 1

    _, cnt = c.most_common(1)[0]

    res = []
    for key, val in c.items():
        if val == cnt:
            res.append(key)

    res.sort()

    for x in res:
        print(x) main MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from collections import Counter

    N = int(readline())
    c = Counter()

    for _ in range(N):
        s = input()
        c[s] += 1

    _, cnt = c.most_common(1)[0]

    res = []
    for key, val in c.items():
        if val == cnt:
            res.append(key)

    res.sort()

    for x in res:
        print(x)


if __name__ == '__main__':
    main()
