def abc155c_poll():
    cnt_dict = {}
    n = int(input())
    for i in range(n):
        s = input()
        if s not in cnt_dict.keys():
            cnt_dict[s] = 1
        else:
            cnt_dict[s] += 1

    max_val = max(cnt_dict.values())
    for k in sorted(cnt_dict):
        if cnt_dict[k] == max_val:
            print(k)

abc155c_poll() def abc155c_poll():
    cnt_dict = {}
    n = int(input())
    for i in range(n):
        s = input()
        if s not in cnt_dict.keys():
            cnt_dict[s] = 1
        else:
            cnt_dict[s] += 1

    max_val = max(cnt_dict.values())
    for k in sorted(cnt_dict):
        if cnt_dict[k] == max_val:
            print(k) abc155c_poll cnt_dict = {} cnt_dict {} n = int(input()) n int(input()) int input() input for i in range(n):
        s = input()
        if s not in cnt_dict.keys():
            cnt_dict[s] = 1
        else:
            cnt_dict[s] += 1

     i range(n) range n s = input() s input() input if s not in cnt_dict.keys():
            cnt_dict[s] = 1
        else:
            cnt_dict[s] += 1

     s not in cnt_dict.keys() s cnt_dict.keys() cnt_dict.keys cnt_dict keys cnt_dict[s] = 1 cnt_dict[s] cnt_dict s 1 cnt_dict[s] += 1 cnt_dict[s] cnt_dict s 1 max_val = max(cnt_dict.values()) max_val max(cnt_dict.values()) max cnt_dict.values() cnt_dict.values cnt_dict values for k in sorted(cnt_dict):
        if cnt_dict[k] == max_val:
            print(k) k sorted(cnt_dict) sorted cnt_dict if cnt_dict[k] == max_val:
            print(k) cnt_dict[k] == max_val cnt_dict[k] cnt_dict k max_val print(k) print k abc155c_poll() abc155c_poll def abc155c_poll():
    cnt_dict = {}
    n = int(input())
    for i in range(n):
        s = input()
        if s not in cnt_dict.keys():
            cnt_dict[s] = 1
        else:
            cnt_dict[s] += 1

    max_val = max(cnt_dict.values())
    for k in sorted(cnt_dict):
        if cnt_dict[k] == max_val:
            print(k) def abc155c_poll():
    cnt_dict = {}
    n = int(input())
    for i in range(n):
        s = input()
        if s not in cnt_dict.keys():
            cnt_dict[s] = 1
        else:
            cnt_dict[s] += 1

    max_val = max(cnt_dict.values())
    for k in sorted(cnt_dict):
        if cnt_dict[k] == max_val:
            print(k) abc155c_poll
def abc155c_poll():
    cnt_dict = {}
    n = int(input())
    for i in range(n):
        s = input()
        if s not in cnt_dict.keys():
            cnt_dict[s] = 1
        else:
            cnt_dict[s] += 1

    max_val = max(cnt_dict.values())
    for k in sorted(cnt_dict):
        if cnt_dict[k] == max_val:
            print(k)

abc155c_poll()