import collections

def poll():
    # 入力
    N = int(input())
    S = list()
    for _ in range(N):
        S.append(input())
    # 各文字列の出現回数をカウント
    count_list = collections.Counter(S)
    # 最大の出現回数のvalueのみ抽出
    max_count = max(count_list.values())
    max_count_str = list()
    for key, value in count_list.items():
        if value == max_count:
            max_count_str.append(key)
    # ソート
    return sorted(max_count_str)
           
result = poll()
for string in result:
    print(string) import collections collections def poll():
    # 入力
    N = int(input())
    S = list()
    for _ in range(N):
        S.append(input())
    # 各文字列の出現回数をカウント
    count_list = collections.Counter(S)
    # 最大の出現回数のvalueのみ抽出
    max_count = max(count_list.values())
    max_count_str = list()
    for key, value in count_list.items():
        if value == max_count:
            max_count_str.append(key)
    # ソート
    return sorted(max_count_str)
            poll N = int(input()) N int(input()) int input() input S = list() S list() list for _ in range(N):
        S.append(input())
    # 各文字列の出現回数をカウント
     _ range(N) range N S.append(input()) S.append S append input() input count_list = collections.Counter(S) count_list collections.Counter(S) collections.Counter collections Counter S max_count = max(count_list.values()) max_count max(count_list.values()) max count_list.values() count_list.values count_list values max_count_str = list() max_count_str list() list for key, value in count_list.items():
        if value == max_count:
            max_count_str.append(key)
    # ソート
     key value count_list.items() count_list.items count_list items if value == max_count:
            max_count_str.append(key)
    # ソート
     value == max_count value max_count max_count_str.append(key) max_count_str.append max_count_str append key return sorted(max_count_str) sorted(max_count_str) sorted max_count_str result = poll() result poll() poll for string in result:
    print(string) string result print(string) print string result = poll() poll() result def poll():
    # 入力
    N = int(input())
    S = list()
    for _ in range(N):
        S.append(input())
    # 各文字列の出現回数をカウント
    count_list = collections.Counter(S)
    # 最大の出現回数のvalueのみ抽出
    max_count = max(count_list.values())
    max_count_str = list()
    for key, value in count_list.items():
        if value == max_count:
            max_count_str.append(key)
    # ソート
    return sorted(max_count_str)
            def poll():
    # 入力
    N = int(input())
    S = list()
    for _ in range(N):
        S.append(input())
    # 各文字列の出現回数をカウント
    count_list = collections.Counter(S)
    # 最大の出現回数のvalueのみ抽出
    max_count = max(count_list.values())
    max_count_str = list()
    for key, value in count_list.items():
        if value == max_count:
            max_count_str.append(key)
    # ソート
    return sorted(max_count_str)
            poll
import collections

def poll():
    # 入力
    N = int(input())
    S = list()
    for _ in range(N):
        S.append(input())
    # 各文字列の出現回数をカウント
    count_list = collections.Counter(S)
    # 最大の出現回数のvalueのみ抽出
    max_count = max(count_list.values())
    max_count_str = list()
    for key, value in count_list.items():
        if value == max_count:
            max_count_str.append(key)
    # ソート
    return sorted(max_count_str)
           
result = poll()
for string in result:
    print(string)