import Control.Monad
import qualified Data.Map as M

main = do
  li <- getLine
  let n = read li
  ss <- forM [1..n] (const getLine)
  let ans = compute ss
  putStrLn (unlines ans)

compute :: [String] -> [String]
compute ss = [s | (s,k) <- M.assocs m, k == x]
  where
    m = M.fromListWith (+) [(s,1)|s <- ss]
    x = maximum $ M.elems m
