import Control.Applicative
import Control.Monad
import Data.Char

toggleCase :: Char -> Char
toggleCase c | 'A' <= c && c <= 'Z'  = chr(ord c - ord 'A' + ord 'a')
toggleCase c | 'a' <= c && c <= 'z'  = chr(ord c - ord 'a' + ord 'A')
toggleCase c = c

toggleString [] = []
toggleString (x:xs) = toggleCase x : toggleString xs


main = do
    s <-getLine
    putStrLn $ toggleString s
    