from collections import Counter


def main():
    n = int(input())
    s = [input() for _ in range(n)]
    counter = Counter(s)
    most_common = counter.most_common()
    max_num = most_common[0][1]
    values, counts = zip(*most_common)
    for i, cnt in enumerate(counts):
        if cnt != max_num:
            last_index = i
            break
    else:
        last_index = len(counter)
    ans = list(values[:last_index])
    ans.sort()
    print("\n".join(ans))


if __name__ == "__main__":
    main() from collections import Counter def main():
    n = int(input())
    s = [input() for _ in range(n)]
    counter = Counter(s)
    most_common = counter.most_common()
    max_num = most_common[0][1]
    values, counts = zip(*most_common)
    for i, cnt in enumerate(counts):
        if cnt != max_num:
            last_index = i
            break
    else:
        last_index = len(counter)
    ans = list(values[:last_index])
    ans.sort()
    print("\n".join(ans)) main n = int(input()) n int(input()) int input() input input() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) input() input s = [input() for _ in range(n)] s [input() for _ in range(n)] counter = Counter(s) counter Counter(s) Counter s most_common = counter.most_common() most_common counter.most_common() counter.most_common counter most_common max_num = most_common[0][1] max_num most_common[0][1] [0] most_common 0 1 values, counts = zip(*most_common) values zip(*most_common) zip *most_common most_common counts for i, cnt in enumerate(counts):
        if cnt != max_num:
            last_index = i
            break
    else:
        last_index = len(counter)
     i cnt enumerate(counts) enumerate counts if cnt != max_num:
            last_index = i
            break
     cnt != max_num cnt max_num last_index = i last_index i break last_index = len(counter) last_index len(counter) len counter ans = list(values[:last_index]) ans list(values[:last_index]) list values[:last_index] values :last_index last_index ans.sort() ans.sort ans sort print("\n".join(ans)) print "\n".join(ans) "\n".join "\n" join ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    s = [input() for _ in range(n)]
    counter = Counter(s)
    most_common = counter.most_common()
    max_num = most_common[0][1]
    values, counts = zip(*most_common)
    for i, cnt in enumerate(counts):
        if cnt != max_num:
            last_index = i
            break
    else:
        last_index = len(counter)
    ans = list(values[:last_index])
    ans.sort()
    print("\n".join(ans)) def main():
    n = int(input())
    s = [input() for _ in range(n)]
    counter = Counter(s)
    most_common = counter.most_common()
    max_num = most_common[0][1]
    values, counts = zip(*most_common)
    for i, cnt in enumerate(counts):
        if cnt != max_num:
            last_index = i
            break
    else:
        last_index = len(counter)
    ans = list(values[:last_index])
    ans.sort()
    print("\n".join(ans)) main
from collections import Counter


def main():
    n = int(input())
    s = [input() for _ in range(n)]
    counter = Counter(s)
    most_common = counter.most_common()
    max_num = most_common[0][1]
    values, counts = zip(*most_common)
    for i, cnt in enumerate(counts):
        if cnt != max_num:
            last_index = i
            break
    else:
        last_index = len(counter)
    ans = list(values[:last_index])
    ans.sort()
    print("\n".join(ans))


if __name__ == "__main__":
    main()
