import collections
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    S = [input().rstrip() for _ in range(N)]
    c = collections.Counter(S).most_common()
    max_freq = None
    max_S = []
    for s, freq in c:
        if max_freq is None:
            max_freq = freq
            max_S.append(s)
        elif freq == max_freq:
            max_S.append(s)
        else:
            break
    print('\n'.join(sorted(max_S)))


if __name__ == "__main__":
    main() import collections collections import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def main():
    N = int(input())
    S = [input().rstrip() for _ in range(N)]
    c = collections.Counter(S).most_common()
    max_freq = None
    max_S = []
    for s, freq in c:
        if max_freq is None:
            max_freq = freq
            max_S.append(s)
        elif freq == max_freq:
            max_S.append(s)
        else:
            break
    print('\n'.join(sorted(max_S))) main N = int(input()) N int(input()) int input() input input().rstrip() for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) input().rstrip() ().rstrip () input rstrip S = [input().rstrip() for _ in range(N)] S [input().rstrip() for _ in range(N)] 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 max_freq = None max_freq None max_S = [] max_S [] for s, freq in c:
        if max_freq is None:
            max_freq = freq
            max_S.append(s)
        elif freq == max_freq:
            max_S.append(s)
        else:
            break
     s freq c if max_freq is None:
            max_freq = freq
            max_S.append(s)
        elif freq == max_freq:
            max_S.append(s)
        else:
            break
     max_freq is None max_freq None max_freq = freq max_freq freq max_S.append(s) max_S.append max_S append s elif freq == max_freq:
            max_S.append(s)
         freq == max_freq freq max_freq max_S.append(s) max_S.append max_S append s break print('\n'.join(sorted(max_S))) print '\n'.join(sorted(max_S)) '\n'.join '\n' join sorted(max_S) sorted max_S if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main input = sys.stdin.readline sys.stdin.readline input def main():
    N = int(input())
    S = [input().rstrip() for _ in range(N)]
    c = collections.Counter(S).most_common()
    max_freq = None
    max_S = []
    for s, freq in c:
        if max_freq is None:
            max_freq = freq
            max_S.append(s)
        elif freq == max_freq:
            max_S.append(s)
        else:
            break
    print('\n'.join(sorted(max_S))) def main():
    N = int(input())
    S = [input().rstrip() for _ in range(N)]
    c = collections.Counter(S).most_common()
    max_freq = None
    max_S = []
    for s, freq in c:
        if max_freq is None:
            max_freq = freq
            max_S.append(s)
        elif freq == max_freq:
            max_S.append(s)
        else:
            break
    print('\n'.join(sorted(max_S))) main
import collections
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    S = [input().rstrip() for _ in range(N)]
    c = collections.Counter(S).most_common()
    max_freq = None
    max_S = []
    for s, freq in c:
        if max_freq is None:
            max_freq = freq
            max_S.append(s)
        elif freq == max_freq:
            max_S.append(s)
        else:
            break
    print('\n'.join(sorted(max_S)))


if __name__ == "__main__":
    main()
