import math
import sys
import collections
import bisect
readline = sys.stdin.readline


def main():
    n = int(readline().rstrip())
    S = [readline().rstrip() for _ in range(n)]
    c = collections.Counter(S)
    keys = sorted(c.keys())
    maxS = c.most_common()[0][1]
    for key in keys:
        if c[key] == maxS:
            print(key)


if __name__ == '__main__':
    main() import math math import sys sys import collections collections import bisect bisect readline = sys.stdin.readline readline sys.stdin.readline sys.stdin sys stdin readline def main():
    n = int(readline().rstrip())
    S = [readline().rstrip() for _ in range(n)]
    c = collections.Counter(S)
    keys = sorted(c.keys())
    maxS = c.most_common()[0][1]
    for key in keys:
        if c[key] == maxS:
            print(key) main n = int(readline().rstrip()) n int(readline().rstrip()) int readline().rstrip() ().rstrip () readline rstrip readline().rstrip() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) readline().rstrip() ().rstrip () readline rstrip S = [readline().rstrip() for _ in range(n)] S [readline().rstrip() for _ in range(n)] c = collections.Counter(S) c collections.Counter(S) collections.Counter collections Counter S keys = sorted(c.keys()) keys sorted(c.keys()) sorted c.keys() c.keys c keys maxS = c.most_common()[0][1] maxS c.most_common()[0][1] [0] c.most_common() c.most_common c most_common 0 1 for key in keys:
        if c[key] == maxS:
            print(key) key keys if c[key] == maxS:
            print(key) c[key] == maxS c[key] c key maxS print(key) print key if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main readline = sys.stdin.readline sys.stdin.readline readline def main():
    n = int(readline().rstrip())
    S = [readline().rstrip() for _ in range(n)]
    c = collections.Counter(S)
    keys = sorted(c.keys())
    maxS = c.most_common()[0][1]
    for key in keys:
        if c[key] == maxS:
            print(key) def main():
    n = int(readline().rstrip())
    S = [readline().rstrip() for _ in range(n)]
    c = collections.Counter(S)
    keys = sorted(c.keys())
    maxS = c.most_common()[0][1]
    for key in keys:
        if c[key] == maxS:
            print(key) main
import math
import sys
import collections
import bisect
readline = sys.stdin.readline


def main():
    n = int(readline().rstrip())
    S = [readline().rstrip() for _ in range(n)]
    c = collections.Counter(S)
    keys = sorted(c.keys())
    maxS = c.most_common()[0][1]
    for key in keys:
        if c[key] == maxS:
            print(key)


if __name__ == '__main__':
    main()
