import java.util.Scanner;
class Main{
	public static void main(String[] args){
 		int n=0;
		String s;
		char m;
 		Scanner sc = new Scanner(System.in);
		s=sc.nextLine();
		for(n=0;n<s.length();n++){
		  m=s.charAt(n);
		  if(m>='A' && m<='Z')
		   System.out.print((char)(m+32));
		  else if(m>='a' && m<='z')
		   System.out.print((char)(m-32));
		  else
		   System.out.print(m);
		   }
		System.out.println();
		}
} import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args){
 		int n=0;
		String s;
		char m;
 		Scanner sc = new Scanner(System.in);
		s=sc.nextLine();
		for(n=0;n<s.length();n++){
		  m=s.charAt(n);
		  if(m>='A' && m<='Z')
		   System.out.print((char)(m+32));
		  else if(m>='a' && m<='z')
		   System.out.print((char)(m-32));
		  else
		   System.out.print(m);
		   }
		System.out.println();
		}
} Main public static void main(String[] args){
 		int n=0;
		String s;
		char m;
 		Scanner sc = new Scanner(System.in);
		s=sc.nextLine();
		for(n=0;n<s.length();n++){
		  m=s.charAt(n);
		  if(m>='A' && m<='Z')
		   System.out.print((char)(m+32));
		  else if(m>='a' && m<='z')
		   System.out.print((char)(m-32));
		  else
		   System.out.print(m);
		   }
		System.out.println();
		} main {
 		int n=0;
		String s;
		char m;
 		Scanner sc = new Scanner(System.in);
		s=sc.nextLine();
		for(n=0;n<s.length();n++){
		  m=s.charAt(n);
		  if(m>='A' && m<='Z')
		   System.out.print((char)(m+32));
		  else if(m>='a' && m<='z')
		   System.out.print((char)(m-32));
		  else
		   System.out.print(m);
		   }
		System.out.println();
		} int n=0; n 0 String s; s char m; m Scanner sc = new Scanner(System.in); sc new Scanner(System.in) s=sc.nextLine() s sc.nextLine() sc.nextLine sc for(n=0;n<s.length();n++){
		  m=s.charAt(n);
		  if(m>='A' && m<='Z')
		   System.out.print((char)(m+32));
		  else if(m>='a' && m<='z')
		   System.out.print((char)(m-32));
		  else
		   System.out.print(m);
		   } n=0; n=0 n 0 n<s.length() n s.length() s.length s n++ n++ n {
		  m=s.charAt(n);
		  if(m>='A' && m<='Z')
		   System.out.print((char)(m+32));
		  else if(m>='a' && m<='z')
		   System.out.print((char)(m-32));
		  else
		   System.out.print(m);
		   } {
		  m=s.charAt(n);
		  if(m>='A' && m<='Z')
		   System.out.print((char)(m+32));
		  else if(m>='a' && m<='z')
		   System.out.print((char)(m-32));
		  else
		   System.out.print(m);
		   } m=s.charAt(n) m s.charAt(n) s.charAt s n if(m>='A' && m<='Z')
		   System.out.print((char)(m+32));
		  else if(m>='a' && m<='z')
		   System.out.print((char)(m-32));
		  else
		   System.out.print(m); m>='A' && m<='Z' m>='A' m 'A' m<='Z' m 'Z' System.out.print((char)(m+32)) System.out.print System.out System System.out (char)(m+32) m 32 if(m>='a' && m<='z')
		   System.out.print((char)(m-32));
		  else
		   System.out.print(m); m>='a' && m<='z' m>='a' m 'a' m<='z' m 'z' System.out.print((char)(m-32)) System.out.print System.out System System.out (char)(m-32) m 32 System.out.print(m) System.out.print System.out System System.out m System.out.println() System.out.println System.out System System.out String[] args args
import java.util.Scanner;
class Main{
	public static void main(String[] args){
 		int n=0;
		String s;
		char m;
 		Scanner sc = new Scanner(System.in);
		s=sc.nextLine();
		for(n=0;n<s.length();n++){
		  m=s.charAt(n);
		  if(m>='A' && m<='Z')
		   System.out.print((char)(m+32));
		  else if(m>='a' && m<='z')
		   System.out.print((char)(m-32));
		  else
		   System.out.print(m);
		   }
		System.out.println();
		}
}
