import Control.Monad
import Data.List

main = do
  str <- getLine
  let n = read str ::Int
  s <- forM [1..n] $ \i -> do
    str <-getLine
    return str
  let list = sort $ map (\xs -> (head xs, length xs)) $ (group . sort) s
  let maxNum = maximum $ map snd list
  let list' = [ str | (str, num) <- list, num == maxNum]
  mapM_ putStrLn list'
