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]



    for a in sorted(keys):

        print(a)





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():
    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]
    for a in sorted(keys):
        print(a)


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()

-    for a in sorted(keys): -        print(a) +    print(("\n".join(sorted(keys))))