solve c = trans codePoint
  where
    codePoint = fromEnum c
    trans codePoint
      | 97 <= codePoint && codePoint <= 122 = toEnum (codePoint - 32) :: Char
      | 65 <= codePoint && codePoint <= 90 = toEnum (codePoint + 32) :: Char
      | otherwise = c

main = do
  string <- getLine
  putStrLn $ map solve string
