import Data.List
 
main = do
    n <- readLn
    ws <- sequence (take n (repeat getLine))
    let tpl = map (\ws -> (head ws, length ws)) (group (sort ws))
    sequence (map putStrLn (map fst ans))
    where ans = [(s,i) | (s,i) <- tpl, i == max' tpl]
 
max' :: [(String, Int)] -> Int
max' [x] = snd x
max' (x:xs) = max (snd x) (max' xs)