import Data.Char

toggleCase :: Char -> Char
toggleCase c | isUpper c = toLower c
             | isLower c = toUpper c
             | otherwise = c

main :: IO ()
main = getLine >>= putStrLn . map toggleCase