import Data.Char (isLower, isUpper, toLower, toUpper)
    
main :: IO ()
main = getLine >>= putStrLn . toggleCases

toggleCases :: String -> String
toggleCases = map toggleCase
    where toggleCase c
              | isUpper c = toLower c
              | isLower c = toUpper c
              | otherwise = c