#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(N: int, S: "List[str]"):
    c = collections.Counter(S).most_common()
    return "\n".join(sorted([i[0] for i in c if i[1] == c[0][1]]))


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    print(f'{solve(N, S)}')


if __name__ == '__main__':
    main() from typing import * import collections collections import functools functools import itertools itertools import math math import sys sys INF = float('inf') INF float('inf') float 'inf' def solve(N: int, S: "List[str]"):
    c = collections.Counter(S).most_common()
    return "\n".join(sorted([i[0] for i in c if i[1] == c[0][1]])) solve c = collections.Counter(S).most_common() c collections.Counter(S).most_common() collections.Counter(S).most_common collections.Counter(S) collections.Counter collections Counter S most_common i[0] for i in c if i[1] == c[0][1] for i in c if i[1] == c[0][1] i c i[1] == c[0][1] i[1] i 1 c[0][1] [0] c 0 1 if i[1] == c[0][1] i[0] i 0 return "\n".join(sorted([i[0] for i in c if i[1] == c[0][1]])) "\n".join(sorted([i[0] for i in c if i[1] == c[0][1]])) "\n".join "\n" join sorted([i[0] for i in c if i[1] == c[0][1]]) sorted [i[0] for i in c if i[1] == c[0][1]] N: int N S: "List[str]" S def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    print(f'{solve(N, S)}') main sys.setrecursionlimit(10 ** 6) sys.setrecursionlimit sys setrecursionlimit 10 ** 6 10 6 def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
     iterate_tokens for line in sys.stdin:
            for word in line.split():
                yield word
     line sys.stdin sys stdin for word in line.split():
                yield word
     word line.split() line.split line split yield word word tokens = iterate_tokens() tokens iterate_tokens() iterate_tokens N = int(next(tokens)) N int(next(tokens)) int next(tokens) next tokens next(tokens) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) next(tokens) next tokens S = [next(tokens) for _ in range(N)] S [next(tokens) for _ in range(N)] print(f'{solve(N, S)}') print f'{solve(N, S)}' if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    print(f'{solve(N, S)}') def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    print(f'{solve(N, S)}') main INF = float('inf') float('inf') INF def solve(N: int, S: "List[str]"):
    c = collections.Counter(S).most_common()
    return "\n".join(sorted([i[0] for i in c if i[1] == c[0][1]])) def solve(N: int, S: "List[str]"):
    c = collections.Counter(S).most_common()
    return "\n".join(sorted([i[0] for i in c if i[1] == c[0][1]])) solve
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(N: int, S: "List[str]"):
    c = collections.Counter(S).most_common()
    return "\n".join(sorted([i[0] for i in c if i[1] == c[0][1]]))


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    print(f'{solve(N, S)}')


if __name__ == '__main__':
    main()
