import Data.List

mode :: (Ord a) => [a] -> [a]
mode ns =
    let dist = (map (\ks -> (head ks, length ks)) . group . sort) ns
        maxn = (maximum . map snd) dist
    in map fst $ filter ((== maxn) . snd) dist

main :: IO ()
main = interact $ unlines . map show . mode . map (read :: String -> Int) . lines