import java.io.*;

class Main {

	public static void main(String args[]) throws IOException {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		String str = br.readLine();
		
		char ch[] = str.toCharArray();
		
		for(int i = 0; i < ch.length; i++){
			if(Character.isUpperCase(ch[i])){
				ch[i] = Character.toLowerCase(ch[i]);
			}else ch[i] = Character.toUpperCase(ch[i]);
		}
		for(int i = 0; i < ch.length; i++){
			System.out.print(ch[i]);
		}	
		System.out.println();
	}
}	 import java.io.*; io.* java class Main {

	public static void main(String args[]) throws IOException {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		String str = br.readLine();
		
		char ch[] = str.toCharArray();
		
		for(int i = 0; i < ch.length; i++){
			if(Character.isUpperCase(ch[i])){
				ch[i] = Character.toLowerCase(ch[i]);
			}else ch[i] = Character.toUpperCase(ch[i]);
		}
		for(int i = 0; i < ch.length; i++){
			System.out.print(ch[i]);
		}	
		System.out.println();
	}
} Main public static void main(String args[]) throws IOException {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		String str = br.readLine();
		
		char ch[] = str.toCharArray();
		
		for(int i = 0; i < ch.length; i++){
			if(Character.isUpperCase(ch[i])){
				ch[i] = Character.toLowerCase(ch[i]);
			}else ch[i] = Character.toUpperCase(ch[i]);
		}
		for(int i = 0; i < ch.length; i++){
			System.out.print(ch[i]);
		}	
		System.out.println();
	} main {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		String str = br.readLine();
		
		char ch[] = str.toCharArray();
		
		for(int i = 0; i < ch.length; i++){
			if(Character.isUpperCase(ch[i])){
				ch[i] = Character.toLowerCase(ch[i]);
			}else ch[i] = Character.toUpperCase(ch[i]);
		}
		for(int i = 0; i < ch.length; i++){
			System.out.print(ch[i]);
		}	
		System.out.println();
	} InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) String str = br.readLine(); str br.readLine() br.readLine br char ch[] = str.toCharArray(); ch str.toCharArray() str.toCharArray str for(int i = 0; i < ch.length; i++){
			if(Character.isUpperCase(ch[i])){
				ch[i] = Character.toLowerCase(ch[i]);
			}else ch[i] = Character.toUpperCase(ch[i]);
		} int i = 0; int i = 0; i 0 i < ch.length i ch.length ch ch.length i++ i++ i {
			if(Character.isUpperCase(ch[i])){
				ch[i] = Character.toLowerCase(ch[i]);
			}else ch[i] = Character.toUpperCase(ch[i]);
		} {
			if(Character.isUpperCase(ch[i])){
				ch[i] = Character.toLowerCase(ch[i]);
			}else ch[i] = Character.toUpperCase(ch[i]);
		} if(Character.isUpperCase(ch[i])){
				ch[i] = Character.toLowerCase(ch[i]);
			}else ch[i] = Character.toUpperCase(ch[i]); Character.isUpperCase(ch[i]) Character.isUpperCase Character ch[i] ch i {
				ch[i] = Character.toLowerCase(ch[i]);
			} ch[i] = Character.toLowerCase(ch[i]) ch[i] ch i Character.toLowerCase(ch[i]) Character.toLowerCase Character ch[i] ch i ch[i] = Character.toUpperCase(ch[i]) ch[i] ch i Character.toUpperCase(ch[i]) Character.toUpperCase Character ch[i] ch i for(int i = 0; i < ch.length; i++){
			System.out.print(ch[i]);
		} int i = 0; int i = 0; i 0 i < ch.length i ch.length ch ch.length i++ i++ i {
			System.out.print(ch[i]);
		} {
			System.out.print(ch[i]);
		} System.out.print(ch[i]) System.out.print System.out System System.out ch[i] ch i System.out.println() System.out.println System.out System System.out String args[] args
import java.io.*;

class Main {

	public static void main(String args[]) throws IOException {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		String str = br.readLine();
		
		char ch[] = str.toCharArray();
		
		for(int i = 0; i < ch.length; i++){
			if(Character.isUpperCase(ch[i])){
				ch[i] = Character.toLowerCase(ch[i]);
			}else ch[i] = Character.toUpperCase(ch[i]);
		}
		for(int i = 0; i < ch.length; i++){
			System.out.print(ch[i]);
		}	
		System.out.println();
	}
}	