import java.io.*;
class Main
{
    public static void main(String args[])throws IOException
    {
	BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
	String str=input.readLine();
	for(int i=0;i<str.length();i++)
	    {
		char b=str.charAt(i);
			
		if(('a'<=b) && (b<='z'))
			    System.out.print(Character.toUpperCase(b));
			
		else if(('A'<=b) && (b<='Z'))
			    System.out.print(Character.toLowerCase(b));
		else System.out.print(b);	
			    

		    
		
	    }
	System.out.println();
    }
} import java.io.*; io.* java class Main
{
    public static void main(String args[])throws IOException
    {
	BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
	String str=input.readLine();
	for(int i=0;i<str.length();i++)
	    {
		char b=str.charAt(i);
			
		if(('a'<=b) && (b<='z'))
			    System.out.print(Character.toUpperCase(b));
			
		else if(('A'<=b) && (b<='Z'))
			    System.out.print(Character.toLowerCase(b));
		else System.out.print(b);	
			    

		    
		
	    }
	System.out.println();
    }
} Main public static void main(String args[])throws IOException
    {
	BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
	String str=input.readLine();
	for(int i=0;i<str.length();i++)
	    {
		char b=str.charAt(i);
			
		if(('a'<=b) && (b<='z'))
			    System.out.print(Character.toUpperCase(b));
			
		else if(('A'<=b) && (b<='Z'))
			    System.out.print(Character.toLowerCase(b));
		else System.out.print(b);	
			    

		    
		
	    }
	System.out.println();
    } main {
	BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
	String str=input.readLine();
	for(int i=0;i<str.length();i++)
	    {
		char b=str.charAt(i);
			
		if(('a'<=b) && (b<='z'))
			    System.out.print(Character.toUpperCase(b));
			
		else if(('A'<=b) && (b<='Z'))
			    System.out.print(Character.toLowerCase(b));
		else System.out.print(b);	
			    

		    
		
	    }
	System.out.println();
    } BufferedReader input=new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) String str=input.readLine(); str input.readLine() input.readLine input for(int i=0;i<str.length();i++)
	    {
		char b=str.charAt(i);
			
		if(('a'<=b) && (b<='z'))
			    System.out.print(Character.toUpperCase(b));
			
		else if(('A'<=b) && (b<='Z'))
			    System.out.print(Character.toLowerCase(b));
		else System.out.print(b);	
			    

		    
		
	    } int i=0; int i=0; i 0 i<str.length() i str.length() str.length str i++ i++ i {
		char b=str.charAt(i);
			
		if(('a'<=b) && (b<='z'))
			    System.out.print(Character.toUpperCase(b));
			
		else if(('A'<=b) && (b<='Z'))
			    System.out.print(Character.toLowerCase(b));
		else System.out.print(b);	
			    

		    
		
	    } {
		char b=str.charAt(i);
			
		if(('a'<=b) && (b<='z'))
			    System.out.print(Character.toUpperCase(b));
			
		else if(('A'<=b) && (b<='Z'))
			    System.out.print(Character.toLowerCase(b));
		else System.out.print(b);	
			    

		    
		
	    } char b=str.charAt(i); b str.charAt(i) str.charAt str i if(('a'<=b) && (b<='z'))
			    System.out.print(Character.toUpperCase(b));
			
		else if(('A'<=b) && (b<='Z'))
			    System.out.print(Character.toLowerCase(b));
		else System.out.print(b); ('a'<=b) && (b<='z') ('a'<=b) 'a' b (b<='z') b 'z' System.out.print(Character.toUpperCase(b)) System.out.print System.out System System.out Character.toUpperCase(b) Character.toUpperCase Character b if(('A'<=b) && (b<='Z'))
			    System.out.print(Character.toLowerCase(b));
		else System.out.print(b); ('A'<=b) && (b<='Z') ('A'<=b) 'A' b (b<='Z') b 'Z' System.out.print(Character.toLowerCase(b)) System.out.print System.out System System.out Character.toLowerCase(b) Character.toLowerCase Character b System.out.print(b) System.out.print System.out System System.out b 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 input=new BufferedReader(new InputStreamReader(System.in));
	String str=input.readLine();
	for(int i=0;i<str.length();i++)
	    {
		char b=str.charAt(i);
			
		if(('a'<=b) && (b<='z'))
			    System.out.print(Character.toUpperCase(b));
			
		else if(('A'<=b) && (b<='Z'))
			    System.out.print(Character.toLowerCase(b));
		else System.out.print(b);	
			    

		    
		
	    }
	System.out.println();
    }
}