import Data.Char
main = getContents >>= putStrLn.solve

solve :: String -> String
solve str = map change str
  where up  = ['A'..'Z']
        low = ['a'..'z']
        change c | elem c up  = toLower c
                 | elem c low = toUpper c
                 | otherwise  = c