import java.util.*

fun Char.toReverseCase() =
    if (this.isUpperCase()) this.toLowerCase() else this.toUpperCase()

fun String.toReverseCase() =
    String(this.toCharArray().map { it.toReverseCase() }.toCharArray())

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val s = scanner.nextLine()
    println(s.toReverseCase())
}

