# coding: utf-8



def main():

    n = int(eval(input()))

    lines = []

    for i in range(0, n):

        lines.append(eval(input()))



    dct = {}

    for l in lines:

        if l in dct:

            dct[l] += 1;

        else:

            dct[l] = 1;



    cmax = max(dct.values())



    print(('\n'.join(sorted([k for k,v in list(dct.items()) if v == cmax]))))



if __name__ == '__main__':

    main()

import collections



N,*S = open(0).read().split()

C = collections.Counter(S)



i = C.most_common()[0][1]

print(*sorted([k for k,v in C.most_common() if v == i]), sep='\n')

# coding: utf-8
def main():
    n = int(eval(input()))
    lines = []
    for i in range(0, n):
        lines.append(eval(input()))
    dct = {}
    for l in lines:
        if l in dct:
            dct[l] += 1
        else:
            dct[l] = 1
    cmax = max(dct.values())
    print(("\n".join(sorted([k for k, v in list(dct.items()) if v == cmax]))))


if __name__ == "__main__":
    main()

import collections

N, *S = open(0).read().split()
C = collections.Counter(S)
i = C.most_common()[0][1]
print(*sorted([k for k, v in C.most_common() if v == i]), sep="\n")

-# coding: utf-8 -def main(): -    n = int(eval(input())) -    lines = [] -    for i in range(0, n): -        lines.append(eval(input())) -    dct = {} -    for l in lines: -        if l in dct: -            dct[l] += 1 -        else: -            dct[l] = 1 -    cmax = max(dct.values()) -    print(("\n".join(sorted([k for k, v in list(dct.items()) if v == cmax])))) +import collections - -if __name__ == "__main__": -    main() +N, *S = open(0).read().split() +C = collections.Counter(S) +i = C.most_common()[0][1] +print(*sorted([k for k, v in C.most_common() if v == i]), sep="\n")