n,*s=map(str,open(0).read().split())
mydict={}
for i in set(s):
    mydict[i]=1
for i in s:
    mydict[i]+=1
    """
    if s[i] in mydict:
        mydict[s[i]]+=1
    else:
        mydict[s[i]]=1
    """
v_max=max(mydict.values())
for i in sorted([kv[0] for kv in mydict.items() if kv[1]==v_max]):
    print(i) n,*s=map(str,open(0).read().split()) n map(str,open(0).read().split()) map str open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split *s s mydict={} mydict {} for i in set(s):
    mydict[i]=1 i set(s) set s mydict[i]=1 mydict[i] mydict i 1 for i in s:
    mydict[i]+=1
    """
    if s[i] in mydict:
        mydict[s[i]]+=1
    else:
        mydict[s[i]]=1
    """ i s mydict[i]+=1 mydict[i] mydict i 1 """
    if s[i] in mydict:
        mydict[s[i]]+=1
    else:
        mydict[s[i]]=1
    """ v_max=max(mydict.values()) v_max max(mydict.values()) max mydict.values() mydict.values mydict values for i in sorted([kv[0] for kv in mydict.items() if kv[1]==v_max]):
    print(i) i sorted([kv[0] for kv in mydict.items() if kv[1]==v_max]) sorted [kv[0] for kv in mydict.items() if kv[1]==v_max] print(i) print i n,*s=map(str,open(0).read().split()) map(str,open(0).read().split()) n v_max=max(mydict.values()) max(mydict.values()) v_max mydict={} {} mydict
n,*s=map(str,open(0).read().split())
mydict={}
for i in set(s):
    mydict[i]=1
for i in s:
    mydict[i]+=1
    """
    if s[i] in mydict:
        mydict[s[i]]+=1
    else:
        mydict[s[i]]=1
    """
v_max=max(mydict.values())
for i in sorted([kv[0] for kv in mydict.items() if kv[1]==v_max]):
    print(i)