import java.io.*;

class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s=br.readLine();
        for(int i=0;i<s.length();i++){
        	if(Character.isUpperCase(s.charAt(i))){
            	System.out.print(s.substring(i,i+1).toLowerCase());
        	}else{
        		System.out.print(s.substring(i,i+1).toUpperCase());
        	}
        }
        System.out.println("");
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s=br.readLine();
        for(int i=0;i<s.length();i++){
        	if(Character.isUpperCase(s.charAt(i))){
            	System.out.print(s.substring(i,i+1).toLowerCase());
        	}else{
        		System.out.print(s.substring(i,i+1).toUpperCase());
        	}
        }
        System.out.println("");
	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s=br.readLine();
        for(int i=0;i<s.length();i++){
        	if(Character.isUpperCase(s.charAt(i))){
            	System.out.print(s.substring(i,i+1).toLowerCase());
        	}else{
        		System.out.print(s.substring(i,i+1).toUpperCase());
        	}
        }
        System.out.println("");
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s=br.readLine();
        for(int i=0;i<s.length();i++){
        	if(Character.isUpperCase(s.charAt(i))){
            	System.out.print(s.substring(i,i+1).toLowerCase());
        	}else{
        		System.out.print(s.substring(i,i+1).toUpperCase());
        	}
        }
        System.out.println("");
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String s=br.readLine(); s br.readLine() br.readLine br for(int i=0;i<s.length();i++){
        	if(Character.isUpperCase(s.charAt(i))){
            	System.out.print(s.substring(i,i+1).toLowerCase());
        	}else{
        		System.out.print(s.substring(i,i+1).toUpperCase());
        	}
        } int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
        	if(Character.isUpperCase(s.charAt(i))){
            	System.out.print(s.substring(i,i+1).toLowerCase());
        	}else{
        		System.out.print(s.substring(i,i+1).toUpperCase());
        	}
        } {
        	if(Character.isUpperCase(s.charAt(i))){
            	System.out.print(s.substring(i,i+1).toLowerCase());
        	}else{
        		System.out.print(s.substring(i,i+1).toUpperCase());
        	}
        } if(Character.isUpperCase(s.charAt(i))){
            	System.out.print(s.substring(i,i+1).toLowerCase());
        	}else{
        		System.out.print(s.substring(i,i+1).toUpperCase());
        	} Character.isUpperCase(s.charAt(i)) Character.isUpperCase Character s.charAt(i) s.charAt s i {
            	System.out.print(s.substring(i,i+1).toLowerCase());
        	} System.out.print(s.substring(i,i+1).toLowerCase()) System.out.print System.out System System.out s.substring(i,i+1).toLowerCase() s.substring(i,i+1).toLowerCase s.substring(i,i+1) s.substring s i i+1 i 1 {
        		System.out.print(s.substring(i,i+1).toUpperCase());
        	} System.out.print(s.substring(i,i+1).toUpperCase()) System.out.print System.out System System.out s.substring(i,i+1).toUpperCase() s.substring(i,i+1).toUpperCase s.substring(i,i+1) s.substring s i i+1 i 1 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 Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s=br.readLine();
        for(int i=0;i<s.length();i++){
        	if(Character.isUpperCase(s.charAt(i))){
            	System.out.print(s.substring(i,i+1).toLowerCase());
        	}else{
        		System.out.print(s.substring(i,i+1).toUpperCase());
        	}
        }
        System.out.println("");
	}
}