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 [] 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]);
			}
		}
		System.out.println(new String(ch));
    }
} 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 [] 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]);
			}
		}
		System.out.println(new String(ch));
    }
} Main public static void main(String[] args)throws IOException{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		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]);
			}
		}
		System.out.println(new String(ch));
    } main {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		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]);
			}
		}
		System.out.println(new String(ch));
    } 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 [] 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]=Character.toUpperCase(ch[i]) ch[i] ch i Character.toUpperCase(ch[i]) Character.toUpperCase Character ch[i] ch i System.out.println(new String(ch)) System.out.println System.out System System.out new String(ch) 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 [] 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]);
			}
		}
		System.out.println(new String(ch));
    }
}