-- Your code here!
-- Your code here!

import Data.List.Split
import Data.List

-- Your code here!
main :: IO()
main = do
  ls <- getLines
  mapM_ putStrLn $ getMosts ls
  
getMosts :: [String] -> [String]
getMosts l = map (\(a,b) -> a) $ filter (\(a,b) -> b == maxnum) cs 
  where 
   cs = counts l
   maxnum = myMax cs

myMax :: [(String,Int)] -> Int
myMax l = maximum $ map (\(a,b) -> b) l

counts :: [String] -> [(String,Int)]
counts l = map count' es
  where
    es = nub l
    count' e = (e, count e l)

count e l = length $ filter (e==) l

getLines =  do
  s <- getContents
  return $ lines s

