local n = io.read("*n", "*l")
local t = {}
for i = 1, n do
  local s = io.read()
  if not t[s] then t[s] = 1
  else t[s] = t[s] + 1
  end
end
local cnt = 0
for k, v in pairs(t) do
  if cnt < v then
    cnt = v
  end
end
local ret = {}
for k, v in pairs(t) do
  if v == cnt then
    table.insert(ret, k)
  end
end
table.sort(ret)
print(table.concat(ret, "\n"))
