st [] = []
st [x] = show(x)
st (x:xs) = show(x) ++ " " ++ st xs

ms [x] = [x]
ms (x:xs)
  | x > y = y:x:ys
  | otherwise = x:y:ys
  where
    (y:ys) = ms xs

mss [] = []
mss xs = y : ms ys
  where
    (y:ys) = ms xs

main = do
  s <- getLine
  putStrLn $ st $ ms $ map (read :: String -> Int) $ words s