import java.util.Scanner

fun main(args:Array<String>){

    val cin = Scanner(System.`in`)
    var str = cin.nextLine()

    for(i in 0..str.length-1){
        if(str[i].isUpperCase()) print(str[i].toLowerCase())
	    if(str[i].isLowerCase()) print(str[i].toUpperCase())
	    if(str[i] < 'A' || str[i] > 'z') print(str[i])
    }
    println()
}

