import qualified Data.Char as Char

main = putStrLn . toggleCases =<< getLine

toggleCases :: String -> String
toggleCases [] = []
toggleCases (x:xs)
    | x `elem` ['a'..'z'] = Char.toUpper x : toggleCases xs
    | x `elem` ['A'..'Z'] = Char.toLower x : toggleCases xs
    | otherwise           = x : toggleCases xs