import Data.List  -- sortBy, group
import Data.Ord   -- comparing

modes ls = map fst . takeWhile ((>= frq) . snd) $ svls
  where vls = map valLen . group . sort $ ls     -- list of value-length pairs
        valLen ls = (head ls, length ls)
        svls = sortBy (flip $ comparing snd) vls -- sorted vls
        frq = snd (head svls)                    -- max frequency

main = do
  s <- getContents               -- get all input
  let ls :: [Int]
      ls = map read . lines $ s  -- break it into a list
      ms = modes ls
  putStr . unlines . map show $ ms