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