import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		String[][] alphabet = new String[2][27];
		alphabet[0][0] = "a";

		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		String[] strAry = str.split("");
		char charAry[] =str.toCharArray();
		for (int i = 0; i < strAry.length; i++) {
			if (Character.isUpperCase(charAry[i])) {
				strAry[i] = strAry[i].toLowerCase();
			} else if(Character.isLowerCase(charAry[i])) {
				strAry[i] = strAry[i].toUpperCase();
			}
			System.out.print(strAry[i]);
		}
		System.out.println("");
	}

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

	public static void main(String[] args) {
		String[][] alphabet = new String[2][27];
		alphabet[0][0] = "a";

		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		String[] strAry = str.split("");
		char charAry[] =str.toCharArray();
		for (int i = 0; i < strAry.length; i++) {
			if (Character.isUpperCase(charAry[i])) {
				strAry[i] = strAry[i].toLowerCase();
			} else if(Character.isLowerCase(charAry[i])) {
				strAry[i] = strAry[i].toUpperCase();
			}
			System.out.print(strAry[i]);
		}
		System.out.println("");
	}

} Main public static void main(String[] args) {
		String[][] alphabet = new String[2][27];
		alphabet[0][0] = "a";

		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		String[] strAry = str.split("");
		char charAry[] =str.toCharArray();
		for (int i = 0; i < strAry.length; i++) {
			if (Character.isUpperCase(charAry[i])) {
				strAry[i] = strAry[i].toLowerCase();
			} else if(Character.isLowerCase(charAry[i])) {
				strAry[i] = strAry[i].toUpperCase();
			}
			System.out.print(strAry[i]);
		}
		System.out.println("");
	} main {
		String[][] alphabet = new String[2][27];
		alphabet[0][0] = "a";

		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		String[] strAry = str.split("");
		char charAry[] =str.toCharArray();
		for (int i = 0; i < strAry.length; i++) {
			if (Character.isUpperCase(charAry[i])) {
				strAry[i] = strAry[i].toLowerCase();
			} else if(Character.isLowerCase(charAry[i])) {
				strAry[i] = strAry[i].toUpperCase();
			}
			System.out.print(strAry[i]);
		}
		System.out.println("");
	} String[][] alphabet = new String[2][27]; alphabet new String[2][27] 2 27 alphabet[0][0] = "a" alphabet[0][0] alphabet[0] alphabet 0 0 "a" Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc String[] strAry = str.split(""); strAry str.split("") str.split str "" char charAry[] =str.toCharArray(); charAry str.toCharArray() str.toCharArray str for (int i = 0; i < strAry.length; i++) {
			if (Character.isUpperCase(charAry[i])) {
				strAry[i] = strAry[i].toLowerCase();
			} else if(Character.isLowerCase(charAry[i])) {
				strAry[i] = strAry[i].toUpperCase();
			}
			System.out.print(strAry[i]);
		} int i = 0; int i = 0; i 0 i < strAry.length i strAry.length strAry strAry.length i++ i++ i {
			if (Character.isUpperCase(charAry[i])) {
				strAry[i] = strAry[i].toLowerCase();
			} else if(Character.isLowerCase(charAry[i])) {
				strAry[i] = strAry[i].toUpperCase();
			}
			System.out.print(strAry[i]);
		} {
			if (Character.isUpperCase(charAry[i])) {
				strAry[i] = strAry[i].toLowerCase();
			} else if(Character.isLowerCase(charAry[i])) {
				strAry[i] = strAry[i].toUpperCase();
			}
			System.out.print(strAry[i]);
		} if (Character.isUpperCase(charAry[i])) {
				strAry[i] = strAry[i].toLowerCase();
			} else if(Character.isLowerCase(charAry[i])) {
				strAry[i] = strAry[i].toUpperCase();
			} Character.isUpperCase(charAry[i]) Character.isUpperCase Character charAry[i] charAry i {
				strAry[i] = strAry[i].toLowerCase();
			} strAry[i] = strAry[i].toLowerCase() strAry[i] strAry i strAry[i].toLowerCase() strAry[i].toLowerCase strAry[i] strAry i if(Character.isLowerCase(charAry[i])) {
				strAry[i] = strAry[i].toUpperCase();
			} Character.isLowerCase(charAry[i]) Character.isLowerCase Character charAry[i] charAry i {
				strAry[i] = strAry[i].toUpperCase();
			} strAry[i] = strAry[i].toUpperCase() strAry[i] strAry i strAry[i].toUpperCase() strAry[i].toUpperCase strAry[i] strAry i System.out.print(strAry[i]) System.out.print System.out System System.out strAry[i] strAry i System.out.println("") System.out.println System.out System System.out "" String[] args args public class Main {

	public static void main(String[] args) {
		String[][] alphabet = new String[2][27];
		alphabet[0][0] = "a";

		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		String[] strAry = str.split("");
		char charAry[] =str.toCharArray();
		for (int i = 0; i < strAry.length; i++) {
			if (Character.isUpperCase(charAry[i])) {
				strAry[i] = strAry[i].toLowerCase();
			} else if(Character.isLowerCase(charAry[i])) {
				strAry[i] = strAry[i].toUpperCase();
			}
			System.out.print(strAry[i]);
		}
		System.out.println("");
	}

} public class Main {

	public static void main(String[] args) {
		String[][] alphabet = new String[2][27];
		alphabet[0][0] = "a";

		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		String[] strAry = str.split("");
		char charAry[] =str.toCharArray();
		for (int i = 0; i < strAry.length; i++) {
			if (Character.isUpperCase(charAry[i])) {
				strAry[i] = strAry[i].toLowerCase();
			} else if(Character.isLowerCase(charAry[i])) {
				strAry[i] = strAry[i].toUpperCase();
			}
			System.out.print(strAry[i]);
		}
		System.out.println("");
	}

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

	public static void main(String[] args) {
		String[][] alphabet = new String[2][27];
		alphabet[0][0] = "a";

		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		String[] strAry = str.split("");
		char charAry[] =str.toCharArray();
		for (int i = 0; i < strAry.length; i++) {
			if (Character.isUpperCase(charAry[i])) {
				strAry[i] = strAry[i].toLowerCase();
			} else if(Character.isLowerCase(charAry[i])) {
				strAry[i] = strAry[i].toUpperCase();
			}
			System.out.print(strAry[i]);
		}
		System.out.println("");
	}

}