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 max = 0
for k, v in pairs(t) do
  if max < v then
    max = v
  end
end
local r = {}
for k, v in pairs(t) do
  if v == max then
    table.insert(r, k)
  end
end
table.sort(r)
for i = 1, #r do
  print(r[i])
end
