import java.io.*;

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