import Data.Char (chr, ord)

toggleChar :: Char -> Char
toggleChar ch
  | 65 <= chi && chi <= 90  = chr $ chi + 32
  | 97 <= chi && chi <= 122 = chr $ chi - 32
  | otherwise               = ch
  where
    chi = ord ch

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

