from collections import Counter

def main():

  n = int(eval(input()))

  s = [eval(input()) for _ in range(n)]

  s_c = Counter(s)

  s_c_l = [c for c in list(s_c.items())]

  m = max([c[1] for c in s_c_l])

  s_c_l_max = [c[0] for c in s_c_l if c[1] == m]

  s_c_l_max_s = set(s_c_l_max)

  s_c_l_max_s = sorted(s_c_l_max_s)

  for ch in s_c_l_max_s:

    print(ch)

  

main()
import sys

read = sys.stdin.read

from collections import Counter

def main():

    n, *s = read().split()

    n = int(n)

    sc = Counter(s)

    scm = sc.most_common()

    maxnum = scm[0][1]

    r = []

    for scme in scm:

        if scme[1] == maxnum:

            r.append(scme[0])

        else:

            break

    r.sort()

    print(*r, sep="\n")



if __name__ == '__main__':

    main()

from collections import Counter


def main():
    n = int(eval(input()))
    s = [eval(input()) for _ in range(n)]
    s_c = Counter(s)
    s_c_l = [c for c in list(s_c.items())]
    m = max([c[1] for c in s_c_l])
    s_c_l_max = [c[0] for c in s_c_l if c[1] == m]
    s_c_l_max_s = set(s_c_l_max)
    s_c_l_max_s = sorted(s_c_l_max_s)
    for ch in s_c_l_max_s:
        print(ch)


main()

import sys

read = sys.stdin.read
from collections import Counter


def main():
    n, *s = read().split()
    n = int(n)
    sc = Counter(s)
    scm = sc.most_common()
    maxnum = scm[0][1]
    r = []
    for scme in scm:
        if scme[1] == maxnum:
            r.append(scme[0])
        else:
            break
    r.sort()
    print(*r, sep="\n")


if __name__ == "__main__":
    main()

+import sys + +read = sys.stdin.read -    n = int(eval(input())) -    s = [eval(input()) for _ in range(n)] -    s_c = Counter(s) -    s_c_l = [c for c in list(s_c.items())] -    m = max([c[1] for c in s_c_l]) -    s_c_l_max = [c[0] for c in s_c_l if c[1] == m] -    s_c_l_max_s = set(s_c_l_max) -    s_c_l_max_s = sorted(s_c_l_max_s) -    for ch in s_c_l_max_s: -        print(ch) +    n, *s = read().split() +    n = int(n) +    sc = Counter(s) +    scm = sc.most_common() +    maxnum = scm[0][1] +    r = [] +    for scme in scm: +        if scme[1] == maxnum: +            r.append(scme[0]) +        else: +            break +    r.sort() +    print(*r, sep="\n") -main() +if __name__ == "__main__": +    main()