import           Control.Applicative
import           Control.Monad
import           Data.List

main :: IO ()
main = do
  a <- map (read::String->Int) . lines <$> getContents
  putStr . unlines . map show $ top3 a []
  where
    top3 [] res = res
    top3 (x:xs) res = top3 xs (take 3 $ insert res)
      where
        insert [] = [x]
        insert (y:ys)
          | x > y = x: y : ys
          | otherwise = y : insert ys
