//??????????????§????????¨?°????????????????
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		String str = br.readLine();
		int strLength = str.length();
		
		for(int i=0; i<strLength; i++) {
			
			if(Character.isUpperCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toLowerCase());
			}	
			else if(Character.isLowerCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toUpperCase());
			}
			else {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a);
			}
		}
		System.out.println(sb.toString());
	}	
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		String str = br.readLine();
		int strLength = str.length();
		
		for(int i=0; i<strLength; i++) {
			
			if(Character.isUpperCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toLowerCase());
			}	
			else if(Character.isLowerCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toUpperCase());
			}
			else {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a);
			}
		}
		System.out.println(sb.toString());
	}	
} Main public static void main(String[] args) throws IOException{
		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		String str = br.readLine();
		int strLength = str.length();
		
		for(int i=0; i<strLength; i++) {
			
			if(Character.isUpperCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toLowerCase());
			}	
			else if(Character.isLowerCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toUpperCase());
			}
			else {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a);
			}
		}
		System.out.println(sb.toString());
	} main {
		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		String str = br.readLine();
		int strLength = str.length();
		
		for(int i=0; i<strLength; i++) {
			
			if(Character.isUpperCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toLowerCase());
			}	
			else if(Character.isLowerCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toUpperCase());
			}
			else {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a);
			}
		}
		System.out.println(sb.toString());
	} BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() String str = br.readLine(); str br.readLine() br.readLine br int strLength = str.length(); strLength str.length() str.length str for(int i=0; i<strLength; i++) {
			
			if(Character.isUpperCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toLowerCase());
			}	
			else if(Character.isLowerCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toUpperCase());
			}
			else {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a);
			}
		} int i=0; int i=0; i 0 i<strLength i strLength i++ i++ i {
			
			if(Character.isUpperCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toLowerCase());
			}	
			else if(Character.isLowerCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toUpperCase());
			}
			else {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a);
			}
		} {
			
			if(Character.isUpperCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toLowerCase());
			}	
			else if(Character.isLowerCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toUpperCase());
			}
			else {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a);
			}
		} if(Character.isUpperCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toLowerCase());
			}	
			else if(Character.isLowerCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toUpperCase());
			}
			else {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a);
			} Character.isUpperCase(str.charAt(i)) Character.isUpperCase Character str.charAt(i) str.charAt str i {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toLowerCase());
			} String a =  String.valueOf(str.charAt(i)); a String.valueOf(str.charAt(i)) String.valueOf String str.charAt(i) str.charAt str i sb.append(a.toLowerCase()) sb.append sb a.toLowerCase() a.toLowerCase a if(Character.isLowerCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toUpperCase());
			}
			else {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a);
			} Character.isLowerCase(str.charAt(i)) Character.isLowerCase Character str.charAt(i) str.charAt str i {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toUpperCase());
			} String a =  String.valueOf(str.charAt(i)); a String.valueOf(str.charAt(i)) String.valueOf String str.charAt(i) str.charAt str i sb.append(a.toUpperCase()) sb.append sb a.toUpperCase() a.toUpperCase a {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a);
			} String a =  String.valueOf(str.charAt(i)); a String.valueOf(str.charAt(i)) String.valueOf String str.charAt(i) str.charAt str i sb.append(a) sb.append sb a System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb String[] args args
//??????????????§????????¨?°????????????????
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		String str = br.readLine();
		int strLength = str.length();
		
		for(int i=0; i<strLength; i++) {
			
			if(Character.isUpperCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toLowerCase());
			}	
			else if(Character.isLowerCase(str.charAt(i))) {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a.toUpperCase());
			}
			else {
				String a =  String.valueOf(str.charAt(i));
				sb.append(a);
			}
		}
		System.out.println(sb.toString());
	}	
}