import scala.io.StdIn

object Main extends App {

  val literal = StdIn.readLine()
  val result = literal.map{ x =>
    if(x.isLetter && x.isLower) x.toUpper
    else if (x.isLetter && x.isUpper) x.toLower
    else x
  }
  println(result)
}
