import scala.io.StdIn

/**
  * AOJ
  */
object Main {

  def main(args: Array[String]): Unit = {
    println(String.valueOf(StdIn.readLine().toCharArray.map( c => if(c.isUpper) c.toLower else c.toUpper)))
  }
}