import scala.io.StdIn._
import Character._

object Main {
  def main(args: Array[String]) {
    def whichCharacter(c: Char): Char = {
      if(isUpperCase(c)) toLowerCase(c)
      else if(isLowerCase(c)) toUpperCase(c)
      else c
    }

    val input = readLine()
    input.foreach(i => print(whichCharacter(i)))
    print("\n")
  }
}