import java.util.*;
class Main{
public char[] solution(char[] arr){
for(int i=0;i<arr.length;i++){
if(arr[i]>=65 && arr[i]<=90) arr[i] =(char)(arr[i]+32);
else arr[i] =(char)(arr[i]-32);
}
return arr;
}
public static void main(String[] args){
Main T = new Main();
Scanner kb = new Scanner(System.in);
String input = kb.next();
char[] arr = input.toCharArray();
System.out.println(T.solution(arr));
}
}
import java.util.*;
class Main{
public String solution(String str){
String answer="";
for(char x: str.toCharArray()){
if(Character.isLowerCase(x)) answer+=Character.toUpperCase(x);
else answer+=Character.toLowerCase(x);
}
return answer;
}
public static void main(String[] args){
Main T = new Main();
Scanner kb = new Scanner(System.in);
String str = kb.next();
System.out.prinltn(T.solution(str));
}
}