import           Control.Arrow ((&&&))
import           Data.List

solve :: [Int] -> [Int]
solve xs = let nl  = map (head &&& length) $ group $ sort xs
               nl' = sortBy (\a b -> compare (snd b) (snd a)) nl
               lm  = snd $ head nl'
               nlm = map fst $ takeWhile (\(_, l) -> l == lm) nl'
           in  nlm

main :: IO ()
main = getContents >>= mapM_ print . solve . map read . lines