import java.util.Scanner
import java.lang.Character.isLowerCase

object Main {

  def main(args: Array[String]) = {
    val sc = new Scanner(System.in)
    val str = sc.next().map { x =>
      if (isLowerCase(x)) {
        x.toUpper
      } else {
        x.toLower
      }
    }
    println(str)
  }
}