import java.util.Scanner;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		
		String 
				input,
				output = "";
		
	//入力
		input = sc.nextLine();
		
	//文字変換
		//String型をchar型へ変換
		char[] c = new char[input.length()];
		c = input.toCharArray();
		
		for(int i = 0;i < c.length;i++){
			//1文字ずつ大文字変換された文字と比較
			if(c[i] == Character.toUpperCase(c[i])){
				output += Character.toLowerCase(c[i]);
			}else{
				output += Character.toUpperCase(c[i]);
			}
		}
		
	//出力
		System.out.println(output);
		
	}
}
 import java.util.Scanner; Scanner java.util class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		
		String 
				input,
				output = "";
		
	//入力
		input = sc.nextLine();
		
	//文字変換
		//String型をchar型へ変換
		char[] c = new char[input.length()];
		c = input.toCharArray();
		
		for(int i = 0;i < c.length;i++){
			//1文字ずつ大文字変換された文字と比較
			if(c[i] == Character.toUpperCase(c[i])){
				output += Character.toLowerCase(c[i]);
			}else{
				output += Character.toUpperCase(c[i]);
			}
		}
		
	//出力
		System.out.println(output);
		
	}
} Main public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		
		String 
				input,
				output = "";
		
	//入力
		input = sc.nextLine();
		
	//文字変換
		//String型をchar型へ変換
		char[] c = new char[input.length()];
		c = input.toCharArray();
		
		for(int i = 0;i < c.length;i++){
			//1文字ずつ大文字変換された文字と比較
			if(c[i] == Character.toUpperCase(c[i])){
				output += Character.toLowerCase(c[i]);
			}else{
				output += Character.toUpperCase(c[i]);
			}
		}
		
	//出力
		System.out.println(output);
		
	} main {
		Scanner sc = new Scanner(System.in);
		
		String 
				input,
				output = "";
		
	//入力
		input = sc.nextLine();
		
	//文字変換
		//String型をchar型へ変換
		char[] c = new char[input.length()];
		c = input.toCharArray();
		
		for(int i = 0;i < c.length;i++){
			//1文字ずつ大文字変換された文字と比較
			if(c[i] == Character.toUpperCase(c[i])){
				output += Character.toLowerCase(c[i]);
			}else{
				output += Character.toUpperCase(c[i]);
			}
		}
		
	//出力
		System.out.println(output);
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String 
				input input output = ""; output "" input = sc.nextLine() input sc.nextLine() sc.nextLine sc char[] c = new char[input.length()]; c new char[input.length()] input.length() input.length input c = input.toCharArray() c input.toCharArray() input.toCharArray input for(int i = 0;i < c.length;i++){
			//1文字ずつ大文字変換された文字と比較
			if(c[i] == Character.toUpperCase(c[i])){
				output += Character.toLowerCase(c[i]);
			}else{
				output += Character.toUpperCase(c[i]);
			}
		} int i = 0; int i = 0; i 0 i < c.length i c.length c c.length i++ i++ i {
			//1文字ずつ大文字変換された文字と比較
			if(c[i] == Character.toUpperCase(c[i])){
				output += Character.toLowerCase(c[i]);
			}else{
				output += Character.toUpperCase(c[i]);
			}
		} {
			//1文字ずつ大文字変換された文字と比較
			if(c[i] == Character.toUpperCase(c[i])){
				output += Character.toLowerCase(c[i]);
			}else{
				output += Character.toUpperCase(c[i]);
			}
		} if(c[i] == Character.toUpperCase(c[i])){
				output += Character.toLowerCase(c[i]);
			}else{
				output += Character.toUpperCase(c[i]);
			} c[i] == Character.toUpperCase(c[i]) c[i] c i Character.toUpperCase(c[i]) Character.toUpperCase Character c[i] c i {
				output += Character.toLowerCase(c[i]);
			} output += Character.toLowerCase(c[i]) output Character.toLowerCase(c[i]) Character.toLowerCase Character c[i] c i {
				output += Character.toUpperCase(c[i]);
			} output += Character.toUpperCase(c[i]) output Character.toUpperCase(c[i]) Character.toUpperCase Character c[i] c i System.out.println(output) System.out.println System.out System System.out output String args[] args
import java.util.Scanner;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		
		String 
				input,
				output = "";
		
	//入力
		input = sc.nextLine();
		
	//文字変換
		//String型をchar型へ変換
		char[] c = new char[input.length()];
		c = input.toCharArray();
		
		for(int i = 0;i < c.length;i++){
			//1文字ずつ大文字変換された文字と比較
			if(c[i] == Character.toUpperCase(c[i])){
				output += Character.toLowerCase(c[i]);
			}else{
				output += Character.toUpperCase(c[i]);
			}
		}
		
	//出力
		System.out.println(output);
		
	}
}

