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

class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();

		char chr ;

		StringBuilder build = new StringBuilder();

		for(int i=0; i<str.length(); i++){

			chr = str.charAt(i);
			if(Character.isLowerCase(chr)){
				build.append(Character.toUpperCase(chr));
			}else {
				build.append(Character.toLowerCase(chr));

			}
		}


		System.out.print(build.toString()+"\n");

	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();

		char chr ;

		StringBuilder build = new StringBuilder();

		for(int i=0; i<str.length(); i++){

			chr = str.charAt(i);
			if(Character.isLowerCase(chr)){
				build.append(Character.toUpperCase(chr));
			}else {
				build.append(Character.toLowerCase(chr));

			}
		}


		System.out.print(build.toString()+"\n");

	}
} Main public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();

		char chr ;

		StringBuilder build = new StringBuilder();

		for(int i=0; i<str.length(); i++){

			chr = str.charAt(i);
			if(Character.isLowerCase(chr)){
				build.append(Character.toUpperCase(chr));
			}else {
				build.append(Character.toLowerCase(chr));

			}
		}


		System.out.print(build.toString()+"\n");

	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();

		char chr ;

		StringBuilder build = new StringBuilder();

		for(int i=0; i<str.length(); i++){

			chr = str.charAt(i);
			if(Character.isLowerCase(chr)){
				build.append(Character.toUpperCase(chr));
			}else {
				build.append(Character.toLowerCase(chr));

			}
		}


		System.out.print(build.toString()+"\n");

	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str = br.readLine(); str br.readLine() br.readLine br char chr ; chr StringBuilder build = new StringBuilder(); build new StringBuilder() for(int i=0; i<str.length(); i++){

			chr = str.charAt(i);
			if(Character.isLowerCase(chr)){
				build.append(Character.toUpperCase(chr));
			}else {
				build.append(Character.toLowerCase(chr));

			}
		} int i=0; int i=0; i 0 i<str.length() i str.length() str.length str i++ i++ i {

			chr = str.charAt(i);
			if(Character.isLowerCase(chr)){
				build.append(Character.toUpperCase(chr));
			}else {
				build.append(Character.toLowerCase(chr));

			}
		} {

			chr = str.charAt(i);
			if(Character.isLowerCase(chr)){
				build.append(Character.toUpperCase(chr));
			}else {
				build.append(Character.toLowerCase(chr));

			}
		} chr = str.charAt(i) chr str.charAt(i) str.charAt str i if(Character.isLowerCase(chr)){
				build.append(Character.toUpperCase(chr));
			}else {
				build.append(Character.toLowerCase(chr));

			} Character.isLowerCase(chr) Character.isLowerCase Character chr {
				build.append(Character.toUpperCase(chr));
			} build.append(Character.toUpperCase(chr)) build.append build Character.toUpperCase(chr) Character.toUpperCase Character chr {
				build.append(Character.toLowerCase(chr));

			} build.append(Character.toLowerCase(chr)) build.append build Character.toLowerCase(chr) Character.toLowerCase Character chr System.out.print(build.toString()+"\n") System.out.print System.out System System.out build.toString()+"\n" build.toString() build.toString build "\n" String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();

		char chr ;

		StringBuilder build = new StringBuilder();

		for(int i=0; i<str.length(); i++){

			chr = str.charAt(i);
			if(Character.isLowerCase(chr)){
				build.append(Character.toUpperCase(chr));
			}else {
				build.append(Character.toLowerCase(chr));

			}
		}


		System.out.print(build.toString()+"\n");

	}
}