import Data.List
main :: IO()
main = do
  tops 3 []

tops :: Int -> [Int] -> IO()
tops num curs = do
  input <- getLine
  if null input
  then
      putStrLn $ intercalate "\n" $ map show curs
  else do
    let n = read input :: Int
        nexts = take num . reverse . sort $ n : curs
    tops num nexts