object Main {
  val offset: Int = 'a' - 'A'

  def main(args: Array[String]): Unit = {
    val toggled = io.StdIn.readLine().map { c =>
      if ('A' <= c && c <= 'Z') {
        (c + offset).toChar
      } else if ('a' <= c && c <= 'z') {
        (c - offset).toChar
      } else
        c
    }
    println(toggled)
  }
}