import java.util.Scanner;

public class Main {
	public static void main(String srgs[]) {
		String str;
		String ans = "";
		int l, i;
		char c;
		Scanner sc = new Scanner(System.in);
		str = sc.nextLine();
		l = str.length();
		for (i = 0; i < l; ++i) {
			c = str.charAt(i);
			if (c >= 'a' && c <= 'z') {
				c = Character.toUpperCase(c);
			} else {
				c = Character.toLowerCase(c);
			}
			ans = ans + c;
		}
		System.out.println(ans);
		sc.close();
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String srgs[]) {
		String str;
		String ans = "";
		int l, i;
		char c;
		Scanner sc = new Scanner(System.in);
		str = sc.nextLine();
		l = str.length();
		for (i = 0; i < l; ++i) {
			c = str.charAt(i);
			if (c >= 'a' && c <= 'z') {
				c = Character.toUpperCase(c);
			} else {
				c = Character.toLowerCase(c);
			}
			ans = ans + c;
		}
		System.out.println(ans);
		sc.close();
	}

} Main public static void main(String srgs[]) {
		String str;
		String ans = "";
		int l, i;
		char c;
		Scanner sc = new Scanner(System.in);
		str = sc.nextLine();
		l = str.length();
		for (i = 0; i < l; ++i) {
			c = str.charAt(i);
			if (c >= 'a' && c <= 'z') {
				c = Character.toUpperCase(c);
			} else {
				c = Character.toLowerCase(c);
			}
			ans = ans + c;
		}
		System.out.println(ans);
		sc.close();
	} main {
		String str;
		String ans = "";
		int l, i;
		char c;
		Scanner sc = new Scanner(System.in);
		str = sc.nextLine();
		l = str.length();
		for (i = 0; i < l; ++i) {
			c = str.charAt(i);
			if (c >= 'a' && c <= 'z') {
				c = Character.toUpperCase(c);
			} else {
				c = Character.toLowerCase(c);
			}
			ans = ans + c;
		}
		System.out.println(ans);
		sc.close();
	} String str; str String ans = ""; ans "" int l l i; i char c; c Scanner sc = new Scanner(System.in); sc new Scanner(System.in) str = sc.nextLine() str sc.nextLine() sc.nextLine sc l = str.length() l str.length() str.length str for (i = 0; i < l; ++i) {
			c = str.charAt(i);
			if (c >= 'a' && c <= 'z') {
				c = Character.toUpperCase(c);
			} else {
				c = Character.toLowerCase(c);
			}
			ans = ans + c;
		} i = 0; i = 0 i 0 i < l i l ++i ++i i {
			c = str.charAt(i);
			if (c >= 'a' && c <= 'z') {
				c = Character.toUpperCase(c);
			} else {
				c = Character.toLowerCase(c);
			}
			ans = ans + c;
		} {
			c = str.charAt(i);
			if (c >= 'a' && c <= 'z') {
				c = Character.toUpperCase(c);
			} else {
				c = Character.toLowerCase(c);
			}
			ans = ans + c;
		} c = str.charAt(i) c str.charAt(i) str.charAt str i if (c >= 'a' && c <= 'z') {
				c = Character.toUpperCase(c);
			} else {
				c = Character.toLowerCase(c);
			} c >= 'a' && c <= 'z' c >= 'a' c 'a' c <= 'z' c 'z' {
				c = Character.toUpperCase(c);
			} c = Character.toUpperCase(c) c Character.toUpperCase(c) Character.toUpperCase Character c {
				c = Character.toLowerCase(c);
			} c = Character.toLowerCase(c) c Character.toLowerCase(c) Character.toLowerCase Character c ans = ans + c ans ans + c ans c System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String srgs[] srgs public class Main {
	public static void main(String srgs[]) {
		String str;
		String ans = "";
		int l, i;
		char c;
		Scanner sc = new Scanner(System.in);
		str = sc.nextLine();
		l = str.length();
		for (i = 0; i < l; ++i) {
			c = str.charAt(i);
			if (c >= 'a' && c <= 'z') {
				c = Character.toUpperCase(c);
			} else {
				c = Character.toLowerCase(c);
			}
			ans = ans + c;
		}
		System.out.println(ans);
		sc.close();
	}

} public class Main {
	public static void main(String srgs[]) {
		String str;
		String ans = "";
		int l, i;
		char c;
		Scanner sc = new Scanner(System.in);
		str = sc.nextLine();
		l = str.length();
		for (i = 0; i < l; ++i) {
			c = str.charAt(i);
			if (c >= 'a' && c <= 'z') {
				c = Character.toUpperCase(c);
			} else {
				c = Character.toLowerCase(c);
			}
			ans = ans + c;
		}
		System.out.println(ans);
		sc.close();
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String srgs[]) {
		String str;
		String ans = "";
		int l, i;
		char c;
		Scanner sc = new Scanner(System.in);
		str = sc.nextLine();
		l = str.length();
		for (i = 0; i < l; ++i) {
			c = str.charAt(i);
			if (c >= 'a' && c <= 'z') {
				c = Character.toUpperCase(c);
			} else {
				c = Character.toLowerCase(c);
			}
			ans = ans + c;
		}
		System.out.println(ans);
		sc.close();
	}

}
