def main():



    N = int(eval(input()))

    d = dict()

    for _ in range(N):

        s = eval(input())

        d[s] = d.get(s, 0) + 1

    max_c = 0

    for s in d:

        max_c = max(max_c, d[s])

    ans = []

    for s in d:

        if d[s] == max_c:

            ans.append(s)

    ans.sort()

    for s in ans:

        print(s)





if __name__ == '__main__':

    main()

def main():



    N = int(eval(input()))

    d = dict()

    cnt = 0

    for _ in range(N):

        s = eval(input())

        d[s] = d.get(s, 0) + 1

        cnt = max(cnt, d[s])

    ans = []

    for s in d:

        if d[s] == cnt: ans.append(s)

    ans = sorted(ans)

    for s in ans:

        print(s)



    # return " ".join(map(str, sorted(ans)))



if __name__ == '__main__':

    main()

    # print(main())

def main():
    N = int(eval(input()))
    d = dict()
    for _ in range(N):
        s = eval(input())
        d[s] = d.get(s, 0) + 1
    max_c = 0
    for s in d:
        max_c = max(max_c, d[s])
    ans = []
    for s in d:
        if d[s] == max_c:
            ans.append(s)
    ans.sort()
    for s in ans:
        print(s)


if __name__ == "__main__":
    main()

def main():
    N = int(eval(input()))
    d = dict()
    cnt = 0
    for _ in range(N):
        s = eval(input())
        d[s] = d.get(s, 0) + 1
        cnt = max(cnt, d[s])
    ans = []
    for s in d:
        if d[s] == cnt:
            ans.append(s)
    ans = sorted(ans)
    for s in ans:
        print(s)
    # return " ".join(map(str, sorted(ans)))


if __name__ == "__main__":
    main()
    # print(main())

+    cnt = 0 -    max_c = 0 -    for s in d: -        max_c = max(max_c, d[s]) +        cnt = max(cnt, d[s]) -        if d[s] == max_c: +        if d[s] == cnt: -    ans.sort() +    ans = sorted(ans) +    # return " ".join(map(str, sorted(ans))) +    # print(main())