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