import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		String input = br.readLine();
		int i = 0;
		char c = input.charAt(i);
		Character character = new Character( c );
		String inputer = character.toString();

		while( true ){
			if( Character.isUpperCase(input.charAt(i)) ){
				sb.append(inputer.toLowerCase());
			}else{
				sb.append(inputer.toUpperCase());
			}
			i++;

			if( input.length()==i ) break;

			 c = input.charAt(i);
			 character = new Character( c );
			 inputer = character.toString();
		}

		System.out.println(sb);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		String input = br.readLine();
		int i = 0;
		char c = input.charAt(i);
		Character character = new Character( c );
		String inputer = character.toString();

		while( true ){
			if( Character.isUpperCase(input.charAt(i)) ){
				sb.append(inputer.toLowerCase());
			}else{
				sb.append(inputer.toUpperCase());
			}
			i++;

			if( input.length()==i ) break;

			 c = input.charAt(i);
			 character = new Character( c );
			 inputer = character.toString();
		}

		System.out.println(sb);
	}
} Main public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		String input = br.readLine();
		int i = 0;
		char c = input.charAt(i);
		Character character = new Character( c );
		String inputer = character.toString();

		while( true ){
			if( Character.isUpperCase(input.charAt(i)) ){
				sb.append(inputer.toLowerCase());
			}else{
				sb.append(inputer.toUpperCase());
			}
			i++;

			if( input.length()==i ) break;

			 c = input.charAt(i);
			 character = new Character( c );
			 inputer = character.toString();
		}

		System.out.println(sb);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		String input = br.readLine();
		int i = 0;
		char c = input.charAt(i);
		Character character = new Character( c );
		String inputer = character.toString();

		while( true ){
			if( Character.isUpperCase(input.charAt(i)) ){
				sb.append(inputer.toLowerCase());
			}else{
				sb.append(inputer.toUpperCase());
			}
			i++;

			if( input.length()==i ) break;

			 c = input.charAt(i);
			 character = new Character( c );
			 inputer = character.toString();
		}

		System.out.println(sb);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuffer sb = new StringBuffer(); sb new StringBuffer() String input = br.readLine(); input br.readLine() br.readLine br int i = 0; i 0 char c = input.charAt(i); c input.charAt(i) input.charAt input i Character character = new Character( c ); character new Character( c ) String inputer = character.toString(); inputer character.toString() character.toString character while( true ){
			if( Character.isUpperCase(input.charAt(i)) ){
				sb.append(inputer.toLowerCase());
			}else{
				sb.append(inputer.toUpperCase());
			}
			i++;

			if( input.length()==i ) break;

			 c = input.charAt(i);
			 character = new Character( c );
			 inputer = character.toString();
		} true {
			if( Character.isUpperCase(input.charAt(i)) ){
				sb.append(inputer.toLowerCase());
			}else{
				sb.append(inputer.toUpperCase());
			}
			i++;

			if( input.length()==i ) break;

			 c = input.charAt(i);
			 character = new Character( c );
			 inputer = character.toString();
		} if( Character.isUpperCase(input.charAt(i)) ){
				sb.append(inputer.toLowerCase());
			}else{
				sb.append(inputer.toUpperCase());
			} Character.isUpperCase(input.charAt(i)) Character.isUpperCase Character input.charAt(i) input.charAt input i {
				sb.append(inputer.toLowerCase());
			} sb.append(inputer.toLowerCase()) sb.append sb inputer.toLowerCase() inputer.toLowerCase inputer {
				sb.append(inputer.toUpperCase());
			} sb.append(inputer.toUpperCase()) sb.append sb inputer.toUpperCase() inputer.toUpperCase inputer i++ i if( input.length()==i ) break; input.length()==i input.length() input.length input i break; c = input.charAt(i) c input.charAt(i) input.charAt input i character = new Character( c ) character new Character( c ) inputer = character.toString() inputer character.toString() character.toString character System.out.println(sb) System.out.println System.out System System.out sb String[] age age public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		String input = br.readLine();
		int i = 0;
		char c = input.charAt(i);
		Character character = new Character( c );
		String inputer = character.toString();

		while( true ){
			if( Character.isUpperCase(input.charAt(i)) ){
				sb.append(inputer.toLowerCase());
			}else{
				sb.append(inputer.toUpperCase());
			}
			i++;

			if( input.length()==i ) break;

			 c = input.charAt(i);
			 character = new Character( c );
			 inputer = character.toString();
		}

		System.out.println(sb);
	}
} public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		String input = br.readLine();
		int i = 0;
		char c = input.charAt(i);
		Character character = new Character( c );
		String inputer = character.toString();

		while( true ){
			if( Character.isUpperCase(input.charAt(i)) ){
				sb.append(inputer.toLowerCase());
			}else{
				sb.append(inputer.toUpperCase());
			}
			i++;

			if( input.length()==i ) break;

			 c = input.charAt(i);
			 character = new Character( c );
			 inputer = character.toString();
		}

		System.out.println(sb);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		String input = br.readLine();
		int i = 0;
		char c = input.charAt(i);
		Character character = new Character( c );
		String inputer = character.toString();

		while( true ){
			if( Character.isUpperCase(input.charAt(i)) ){
				sb.append(inputer.toLowerCase());
			}else{
				sb.append(inputer.toUpperCase());
			}
			i++;

			if( input.length()==i ) break;

			 c = input.charAt(i);
			 character = new Character( c );
			 inputer = character.toString();
		}

		System.out.println(sb);
	}
}