def main():

    from collections import Counter



    N = int(eval(input()))

    S = [eval(input()) for _ in range(N)]



    c = Counter(S)

    _max = max(c.values())



    keys = [k for k, v in list(c.items()) if v == _max]

    print(('\n'.join(sorted(keys))))



if __name__ == '__main__':

    main()

def main():

    import sys

    from collections import Counter



    N = int(eval(input()))

    S = [sys.stdin.readline().rstrip('\n') for _ in range(N)]

    c = Counter(S)

    _max = max(c.values())

    keys = [k for k, v in list(c.items()) if v == _max]

    print(('\n'.join(sorted(keys))))



if __name__ == '__main__':

    main()
def main():
    from collections import Counter

    N = int(eval(input()))
    S = [eval(input()) for _ in range(N)]
    c = Counter(S)
    _max = max(c.values())
    keys = [k for k, v in list(c.items()) if v == _max]
    print(("\n".join(sorted(keys))))


if __name__ == "__main__":
    main()

def main():
    import sys
    from collections import Counter

    N = int(eval(input()))
    S = [sys.stdin.readline().rstrip("\n") for _ in range(N)]
    c = Counter(S)
    _max = max(c.values())
    keys = [k for k, v in list(c.items()) if v == _max]
    print(("\n".join(sorted(keys))))


if __name__ == "__main__":
    main()

+    import sys -    S = [eval(input()) for _ in range(N)] +    S = [sys.stdin.readline().rstrip("\n") for _ in range(N)]