import scala.io.StdIn._

object Main {
  def main(args: Array[String]) {
    val convertCharacter =
      readLine().map(c => if(c.isUpper) c.toLower else if(c.isLower) c.toUpper else c)

    println(convertCharacter)
  }
}