import Data.Char

solve :: String -> String
solve s = map toggle s
    where
        toggle c
            | isAsciiLower c = toUpper c
            | isAsciiUpper c = toLower c
            | otherwise      = c

main :: IO ()
main = getLine >>= putStrLn . solve