import Data.List
main = interact $ unlines . map show . mode_value . map (read::String->Int) . lines
mode_value ns = map head $ filter (\xs -> length xs == modes) ns'
 where
  modes = maximum (map length ns')
  ns' = group (sort ns)