import Data.Array
import Data.Array.ST

main = do
    list <- getContents
    let nums = map (read :: String -> Int).lines $ list
        arr  = addNums nums
    mapM_ print $ findModeValue arr

modifyArray a i f = fmap f (readArray a i) >>= writeArray a i

addNums :: [Int] -> Array Int Int
addNums list = runSTArray $ do
    arr <- newArray (1,100) 0
    mapM_ (\i -> modifyArray arr i (+1)) list
    return arr

findModeValue arr = find' arr 0 [] ixs
    where ixs = range.bounds $ arr

find' _   _  mvals [] = reverse mvals
find' arr mx mvals (x:xs)
    | arr ! x >  mx = find' arr (arr ! x) [x] xs
    | arr ! x == mx = find' arr mx (x:mvals) xs
    | arr ! x <  mx = find' arr mx mvals xs