import sys

import collections

input = lambda: sys.stdin.readline().rstrip()



def main():

    n = int(input())

    s = [input() for _ in range(n)]

    cnt = collections.Counter(s)

    values, counts = zip(*cnt.most_common())

    d = sorted(values[:counts.count(counts[0])])

    print(*d, sep='\n')



if __name__ == '__main__':

    main()

import sys

import collections

input = lambda: sys.stdin.readline().rstrip()



def main():

    n = int(input())

    s = [input() for _ in range(n)]

    cnt = collections.Counter(s)

    cnt_max = max(cnt.values())

    d = [k for k, v in cnt.items() if v == cnt_max]

    d = sorted(d)

    print(*d, sep='\n')



if __name__ == '__main__':

    main()

import sys
import collections

input = lambda: sys.stdin.readline().rstrip()


def main():
    n = int(input())
    s = [input() for _ in range(n)]
    cnt = collections.Counter(s)
    values, counts = zip(*cnt.most_common())
    d = sorted(values[: counts.count(counts[0])])
    print(*d, sep="\n")


if __name__ == "__main__":
    main()

import sys
import collections

input = lambda: sys.stdin.readline().rstrip()


def main():
    n = int(input())
    s = [input() for _ in range(n)]
    cnt = collections.Counter(s)
    cnt_max = max(cnt.values())
    d = [k for k, v in cnt.items() if v == cnt_max]
    d = sorted(d)
    print(*d, sep="\n")


if __name__ == "__main__":
    main()

-    values, counts = zip(*cnt.most_common()) -    d = sorted(values[: counts.count(counts[0])]) +    cnt_max = max(cnt.values()) +    d = [k for k, v in cnt.items() if v == cnt_max] +    d = sorted(d)