import Data.Char
import Control.Applicative

toggleString :: String -> String
toggleString s = map toggleChar s
    where
        toggleChar :: Char -> Char
        toggleChar c
            | elem c ['a' .. 'z'] = toUpper c
            | elem c ['A' .. 'Z'] = toLower c
            | otherwise           = c

main :: IO ()
main = putStrLn =<< toggleString <$> getLine