import Data.Char

main = getLine >>= putStrLn . solve

solve :: String -> String
solve (c:[])  = [c]
solve (c:cs)
    | c `elem` ['a'..'z'] = toUpper c : solve cs
    | c `elem` ['A'..'Z'] = toLower c : solve cs
    | otherwise           = c : solve cs
