local N = io.read("n", "l")
local counts = setmetatable({}, {__index=function()return 0 end})
local max = 0
for i=1,N do
  local s = io.read("l")
  counts[s] = counts[s] + 1
  if counts[s] > max then
    max = counts[s]
  end
end
local anstbl = {}
for s, c in pairs(counts) do
  if c == max then
    table.insert(anstbl, s)
  end
end
table.sort(anstbl)
for i=1,#anstbl do
  print(anstbl[i])
end
