import Data.List
import Control.Monad
f ::Int -> [String] -> Bool
f x y = if (x== length y) then True else False
main = do
 n <- readLn 
 s <-  replicateM n getLine
 let s' = group (sort s)
 let s'' = map (length) (s')
 mapM_ putStrLn (map head (filter (f (maximum s'')) s'))