import Data.Char

swap :: Char -> Char
swap c
  | c == toUpper c = toLower c
  | otherwise      = toUpper c

solver :: String -> String
solver = map swap

main :: IO()
main = do
  str <- getLine
  putStrLn $ solver str