def main():

    import sys

    import collections

    input = sys.stdin.readline

    N = int(input())

    S = [input() for i in range(N)]

    c = collections.Counter(S)

    max_num = c.most_common(1)[0][1]

    ss = [cc[0] for cc in c.most_common() if cc[1] == max_num]

    ss.sort()

    for s in ss:

        print(s,end="")



if __name__ == "__main__":

    main()

def main():

    import sys

    import collections

    input = sys.stdin.readline

    N = int(eval(input()))

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

    c = collections.Counter(S)

    max_num = c.most_common(1)[0][1]

    ss = [cc[0] for cc in c.most_common() if cc[1] == max_num]

    ss.sort()

    print(("\n".join(ss)))



if __name__ == "__main__":

    main()
def main():
    import sys
    import collections

    input = sys.stdin.readline
    N = int(input())
    S = [input() for i in range(N)]
    c = collections.Counter(S)
    max_num = c.most_common(1)[0][1]
    ss = [cc[0] for cc in c.most_common() if cc[1] == max_num]
    ss.sort()
    for s in ss:
        print(s, end="")


if __name__ == "__main__":
    main()

def main():
    import sys
    import collections

    input = sys.stdin.readline
    N = int(eval(input()))
    S = [eval(input()) for i in range(N)]
    c = collections.Counter(S)
    max_num = c.most_common(1)[0][1]
    ss = [cc[0] for cc in c.most_common() if cc[1] == max_num]
    ss.sort()
    print(("\n".join(ss)))


if __name__ == "__main__":
    main()

-    N = int(input()) -    S = [input() for i in range(N)] +    N = int(eval(input())) +    S = [eval(input()) for i in range(N)] -    for s in ss: -        print(s, end="") +    print(("\n".join(ss)))