fun main(args: Array<String>) {
    val input = readLine() ?: return
    val builder = StringBuilder()
    input.forEach {
        val newC = when {
            it.isLowerCase() -> it.toUpperCase()
            it.isUpperCase() -> it.toLowerCase()
            else -> it
        }
        builder.append(newC)
    }
    println(builder.toString())
}
