from collections import *

N = int(eval(input()))

c = Counter()

m = 0



for i in range(N):

    S = eval(input())

    c[S] += 1

    m = max(m, c[S])



ans = sorted([k for k, v in list(c.items()) if v == m])

print(('\n'.join(ans)))
from collections import *

import sys

input = sys.stdin.readline



def main():

    N = int(eval(input()))

    c = Counter()

    m = 0

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

    for s in S:

        c[s] += 1

        m = max(m, c[s])



    ans = sorted([k for k, v in list(c.items()) if v == m])

    print(('\n'.join(ans)))

if __name__ == '__main__':

    main()
from collections import *

N = int(eval(input()))
c = Counter()
m = 0
for i in range(N):
    S = eval(input())
    c[S] += 1
    m = max(m, c[S])
ans = sorted([k for k, v in list(c.items()) if v == m])
print(("\n".join(ans)))

from collections import *
import sys

input = sys.stdin.readline


def main():
    N = int(eval(input()))
    c = Counter()
    m = 0
    S = [eval(input()) for i in range(N)]
    for s in S:
        c[s] += 1
        m = max(m, c[s])
    ans = sorted([k for k, v in list(c.items()) if v == m])
    print(("\n".join(ans)))


if __name__ == "__main__":
    main()

+import sys -N = int(eval(input())) -c = Counter() -m = 0 -for i in range(N): -    S = eval(input()) -    c[S] += 1 -    m = max(m, c[S]) -ans = sorted([k for k, v in list(c.items()) if v == m]) -print(("\n".join(ans))) +input = sys.stdin.readline + + +def main(): +    N = int(eval(input())) +    c = Counter() +    m = 0 +    S = [eval(input()) for i in range(N)] +    for s in S: +        c[s] += 1 +        m = max(m, c[s]) +    ans = sorted([k for k, v in list(c.items()) if v == m]) +    print(("\n".join(ans))) + + +if __name__ == "__main__": +    main()