import Data.Char (isUpper, toLower, toUpper)

swapCase :: Char -> Char
swapCase c
  | isUpper c = toLower c
  | otherwise = toUpper c

main :: IO ()
main = do
  s <- getLine
  putStrLn $ map swapCase s