import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		while (true) {
			
			String str = scan.next();
			// strArry????????????????????????????´?
			String[] strArry = str.split("");

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

				// strArry[i]?????§??????????°??????????????????????
				// ??????????????????

				if (Character.isUpperCase(strArry[i].charAt(0))) {

					strArry[i] = strArry[i].toLowerCase();

				} else {
					strArry[i] = strArry[i].toUpperCase();
				}

				System.out.print(strArry[i]);

			}
			
			if (scan.hasNext() == false) {
				break;
			}
			
			System.out.print(" ");
		}
		 System.out.println(); 
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		while (true) {
			
			String str = scan.next();
			// strArry????????????????????????????´?
			String[] strArry = str.split("");

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

				// strArry[i]?????§??????????°??????????????????????
				// ??????????????????

				if (Character.isUpperCase(strArry[i].charAt(0))) {

					strArry[i] = strArry[i].toLowerCase();

				} else {
					strArry[i] = strArry[i].toUpperCase();
				}

				System.out.print(strArry[i]);

			}
			
			if (scan.hasNext() == false) {
				break;
			}
			
			System.out.print(" ");
		}
		 System.out.println(); 
	}

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

		Scanner scan = new Scanner(System.in);

		while (true) {
			
			String str = scan.next();
			// strArry????????????????????????????´?
			String[] strArry = str.split("");

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

				// strArry[i]?????§??????????°??????????????????????
				// ??????????????????

				if (Character.isUpperCase(strArry[i].charAt(0))) {

					strArry[i] = strArry[i].toLowerCase();

				} else {
					strArry[i] = strArry[i].toUpperCase();
				}

				System.out.print(strArry[i]);

			}
			
			if (scan.hasNext() == false) {
				break;
			}
			
			System.out.print(" ");
		}
		 System.out.println(); 
	} main {

		Scanner scan = new Scanner(System.in);

		while (true) {
			
			String str = scan.next();
			// strArry????????????????????????????´?
			String[] strArry = str.split("");

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

				// strArry[i]?????§??????????°??????????????????????
				// ??????????????????

				if (Character.isUpperCase(strArry[i].charAt(0))) {

					strArry[i] = strArry[i].toLowerCase();

				} else {
					strArry[i] = strArry[i].toUpperCase();
				}

				System.out.print(strArry[i]);

			}
			
			if (scan.hasNext() == false) {
				break;
			}
			
			System.out.print(" ");
		}
		 System.out.println(); 
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) while (true) {
			
			String str = scan.next();
			// strArry????????????????????????????´?
			String[] strArry = str.split("");

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

				// strArry[i]?????§??????????°??????????????????????
				// ??????????????????

				if (Character.isUpperCase(strArry[i].charAt(0))) {

					strArry[i] = strArry[i].toLowerCase();

				} else {
					strArry[i] = strArry[i].toUpperCase();
				}

				System.out.print(strArry[i]);

			}
			
			if (scan.hasNext() == false) {
				break;
			}
			
			System.out.print(" ");
		} true {
			
			String str = scan.next();
			// strArry????????????????????????????´?
			String[] strArry = str.split("");

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

				// strArry[i]?????§??????????°??????????????????????
				// ??????????????????

				if (Character.isUpperCase(strArry[i].charAt(0))) {

					strArry[i] = strArry[i].toLowerCase();

				} else {
					strArry[i] = strArry[i].toUpperCase();
				}

				System.out.print(strArry[i]);

			}
			
			if (scan.hasNext() == false) {
				break;
			}
			
			System.out.print(" ");
		} String str = scan.next(); str scan.next() scan.next scan String[] strArry = str.split(""); strArry str.split("") str.split str "" for (int i = 0; i < strArry.length; i++) {

				// strArry[i]?????§??????????°??????????????????????
				// ??????????????????

				if (Character.isUpperCase(strArry[i].charAt(0))) {

					strArry[i] = strArry[i].toLowerCase();

				} else {
					strArry[i] = strArry[i].toUpperCase();
				}

				System.out.print(strArry[i]);

			} int i = 0; int i = 0; i 0 i < strArry.length i strArry.length strArry strArry.length i++ i++ i {

				// strArry[i]?????§??????????°??????????????????????
				// ??????????????????

				if (Character.isUpperCase(strArry[i].charAt(0))) {

					strArry[i] = strArry[i].toLowerCase();

				} else {
					strArry[i] = strArry[i].toUpperCase();
				}

				System.out.print(strArry[i]);

			} {

				// strArry[i]?????§??????????°??????????????????????
				// ??????????????????

				if (Character.isUpperCase(strArry[i].charAt(0))) {

					strArry[i] = strArry[i].toLowerCase();

				} else {
					strArry[i] = strArry[i].toUpperCase();
				}

				System.out.print(strArry[i]);

			} if (Character.isUpperCase(strArry[i].charAt(0))) {

					strArry[i] = strArry[i].toLowerCase();

				} else {
					strArry[i] = strArry[i].toUpperCase();
				} Character.isUpperCase(strArry[i].charAt(0)) Character.isUpperCase Character strArry[i].charAt(0) strArry[i].charAt strArry[i] strArry i 0 {

					strArry[i] = strArry[i].toLowerCase();

				} strArry[i] = strArry[i].toLowerCase() strArry[i] strArry i strArry[i].toLowerCase() strArry[i].toLowerCase strArry[i] strArry i {
					strArry[i] = strArry[i].toUpperCase();
				} strArry[i] = strArry[i].toUpperCase() strArry[i] strArry i strArry[i].toUpperCase() strArry[i].toUpperCase strArry[i] strArry i System.out.print(strArry[i]) System.out.print System.out System System.out strArry[i] strArry i if (scan.hasNext() == false) {
				break;
			} scan.hasNext() == false scan.hasNext() scan.hasNext scan false {
				break;
			} break; System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		while (true) {
			
			String str = scan.next();
			// strArry????????????????????????????´?
			String[] strArry = str.split("");

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

				// strArry[i]?????§??????????°??????????????????????
				// ??????????????????

				if (Character.isUpperCase(strArry[i].charAt(0))) {

					strArry[i] = strArry[i].toLowerCase();

				} else {
					strArry[i] = strArry[i].toUpperCase();
				}

				System.out.print(strArry[i]);

			}
			
			if (scan.hasNext() == false) {
				break;
			}
			
			System.out.print(" ");
		}
		 System.out.println(); 
	}

} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		while (true) {
			
			String str = scan.next();
			// strArry????????????????????????????´?
			String[] strArry = str.split("");

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

				// strArry[i]?????§??????????°??????????????????????
				// ??????????????????

				if (Character.isUpperCase(strArry[i].charAt(0))) {

					strArry[i] = strArry[i].toLowerCase();

				} else {
					strArry[i] = strArry[i].toUpperCase();
				}

				System.out.print(strArry[i]);

			}
			
			if (scan.hasNext() == false) {
				break;
			}
			
			System.out.print(" ");
		}
		 System.out.println(); 
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		while (true) {
			
			String str = scan.next();
			// strArry????????????????????????????´?
			String[] strArry = str.split("");

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

				// strArry[i]?????§??????????°??????????????????????
				// ??????????????????

				if (Character.isUpperCase(strArry[i].charAt(0))) {

					strArry[i] = strArry[i].toLowerCase();

				} else {
					strArry[i] = strArry[i].toUpperCase();
				}

				System.out.print(strArry[i]);

			}
			
			if (scan.hasNext() == false) {
				break;
			}
			
			System.out.print(" ");
		}
		 System.out.println(); 
	}

}