import Data.Char

solv :: String -> String
solv [] = ""
solv (x:xs) | isUpper x = toLower x : solv xs
            | isLower x = toUpper x : solv xs
            | otherwise = x : solv xs

main = getLine >>= putStrLn . solv