n=io.read("*n","*l")
t={}
frequency=0
for i=1,n do
    s=io.read()
    if not t[s] then
        t[s]=1
    else
        t[s]=t[s]+1
    end
    frequency=math.max(frequency,t[s])
end
w={}
for k,v in pairs(t) do
    if v==frequency then
        table.insert(w,k)
    end
end
table.sort(w)
for k,v in pairs(w) do
    print(v)
end