import Data.List
import Control.Monad
main = do
 n <- readLn  
 s <-  replicateM n getLine
 let s' = group (sort s)
 let s'' = map (length) (s')
 let ind = elemIndices (maximum s'') s''
 mapM_ putStrLn([head((s')!!t)|t<-ind])