Problem:
Score : 100 points

Problem Statement

We have three boxes A, B, and C, each of which contains an integer.

Currently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.

We will now do the operations below in order. Find the content of each box afterward.

Swap the contents of the boxes A and B

Swap the contents of the boxes A and C

Constraints

1 \leq X,Y,Z \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

X Y Z

Output

Print the integers contained in the boxes A, B, and C, in this order, with space in between.

Sample Input 1

1 2 3

Sample Output 1

3 1 2

After the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.

Then, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.

Sample Input 2

100 100 100

Sample Output 2

100 100 100

Sample Input 3

41 59 31

Sample Output 3

31 41 59

Solution in Haskell (GHC 7.10.3) (judge verdict: Accepted)

import Data.Char
import Data.List
import System.IO
import Control.Applicative
import Control.Monad
-- https://hoogle.haskell.org で関数検索

{- お客様の中でHaskellを書ける方はいらっしゃいますか？
    と、Haskellの例がなくて困っていたところを @tanakh さんに助けて頂きました。本当にありがとうございました。-}
main :: IO ()
main = do
    [a,b,c] <- getIntegerList
    putStrLn $ (show c) ++ " " ++ (show a) ++ " " ++ (show b)

{-
main :: IO ()
main = do
    -- 整数の入力
    a <- readLn
    -- スペース区切り整数の入力
    [b, c] <- getIntegerList

    --[b, c] <- map read . words <$> getLine
    -- 文字列の入力
    s <- getLine
    -- 出力
    putStrLn $ show (a + b + c) ++ " " ++ s
-}

-- レイアウト規則

fac 0 = 1
fac n = n * fac (n-1)

-- it ... 前回の結果を保存
-- :l :load  ロードする
-- :set +m 複数行
-- http://www.kotha.net/ghcguide_ja/latest/ghci.html#ghci-introduction 参考資料
--
-- sum read show min max abs 
-- head tail take drop ++ (n:ns)      takewhile dropwhile odd [1..10]
-- zip id const length /= 'div' 'mod' cons
-- fst first(tuple) snd second(tuple) 
--any all 

--ラムダ式　( \x -> x+x )
-- map f [1..10]
--   where f x = x^2 +1

rabs n | n>=0 =n 
           | otherwise = -n
           
xor :: Bool -> Bool -> Bool
xor True    True    = False
xor False  False   = False
xor _         _          = True

halve xs = (take half xs,drop half xs)
        where half = (length  xs) `div` 2
        
safetail xs    
        | xs==[]      = []
        | otherwise = tail xs
        
fibs n = [ x^2 | x <- [1 .. n] ]

factors n = [ k | k <- [1..n] , n `mod` k == 0 ]
prime n = factors n == [1, n]

-- sum xs = foldr (+) 0 xs

compose xs = foldr (.) id xs

count x = length . filter (== x)
rmdups [] = []
rmdups (x:xs) = x: rmdups (filter (/=x) xs)

unfold fin makeele next x 
        | fin x = []
        | otherwise = makeele x : unfold fin makeele next (next x)

int2bit num = unfold (==0) (`mod`2) (`div`2) num 

-- type ...型に別名をつける　再起不可能
-- data ...再帰可能　全く新しい型
-- newtype ...型に別名をつけるが内部上も別物として扱われる　安全性を高めるため使う　再帰可能！
-- instance Eq Bool where
--       False == False = True
--       True  ==  True = True
--       _       ==   _      = False

-- deriving (Eq, Ord, Show, Read)
-- getChar putChar return getLine putStr putStrLn

-- cls = putStr "\ESC[2J"  画面クリア









-- FileName   : 164a
-- CreatedDate: 2020-04-26 20:56:13

--------------------------------------------  https://atcoder.jp/contests/abc164/submissions/12342628

getIntList        = map (read :: String -> Int) . words <$> getLine
getIntegerList    = map (read :: String -> Integer) . words <$> getLine
getIntegerListN m = map (read :: String -> Integer) <$> replicateM m getLine


base :: Integer
base = 1000000007

plus :: Integer -> Integer -> Integer
plus a b = (a+b) `mod` base

times :: Integer -> Integer -> Integer
times a b = a * b `mod` base

minus :: Integer -> Integer -> Integer
minus a b
   | a < b     = a-b + base
   | otherwise = a-b

power :: Integer -> Integer -> Integer
power n k
   | k == 0         = 1
   | k `mod` 2 == 0 = power (times n n) (k`div`2)
   | otherwise      = times n $! power n (k-1)

inv :: Integer -> Integer
inv n = power n $ base - 2

binom :: Integer -> Integer -> Integer
binom n m
   | (n-m) < m = times (foldr times 1 [m+1..n]) $ inv $ foldr times 1 [1..n-m]
   | otherwise = times (foldr times 1 [n-m+1..n]) $ inv $ foldr times 1 [1..m]