import scala.io.StdIn.readLine

object Main {
  def main(args: Array[String]) {
    val input = readLine()
    val ans = input.map(char => if (char.isLower) char.toUpper else char.toLower)
    println(ans)
  }
}

