object Main extends App {
  val scanner = new java.util.Scanner(System.in)

  val input = scanner.nextLine()

  val output = input.map { c =>
    if(c.isLower) c.toUpper
    else          c.toLower
  }

  println(output)
}