import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		String s = stdIn.nextLine();
		String ans = "";
		for (int i=0; i<s.length(); i++) {
			if (Character.isUpperCase(s.charAt(i))) {
				ans += Character.toLowerCase(s.charAt(i));
			}else if (Character.isLowerCase(s.charAt(i))) {
				ans += Character.toUpperCase(s.charAt(i));
			}else{
				ans += s.charAt(i);
			}
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		String s = stdIn.nextLine();
		String ans = "";
		for (int i=0; i<s.length(); i++) {
			if (Character.isUpperCase(s.charAt(i))) {
				ans += Character.toLowerCase(s.charAt(i));
			}else if (Character.isLowerCase(s.charAt(i))) {
				ans += Character.toUpperCase(s.charAt(i));
			}else{
				ans += s.charAt(i);
			}
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		String s = stdIn.nextLine();
		String ans = "";
		for (int i=0; i<s.length(); i++) {
			if (Character.isUpperCase(s.charAt(i))) {
				ans += Character.toLowerCase(s.charAt(i));
			}else if (Character.isLowerCase(s.charAt(i))) {
				ans += Character.toUpperCase(s.charAt(i));
			}else{
				ans += s.charAt(i);
			}
		}
		System.out.println(ans);
	} main {
		Scanner stdIn = new Scanner(System.in);
		String s = stdIn.nextLine();
		String ans = "";
		for (int i=0; i<s.length(); i++) {
			if (Character.isUpperCase(s.charAt(i))) {
				ans += Character.toLowerCase(s.charAt(i));
			}else if (Character.isLowerCase(s.charAt(i))) {
				ans += Character.toUpperCase(s.charAt(i));
			}else{
				ans += s.charAt(i);
			}
		}
		System.out.println(ans);
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) String s = stdIn.nextLine(); s stdIn.nextLine() stdIn.nextLine stdIn String ans = ""; ans "" for (int i=0; i<s.length(); i++) {
			if (Character.isUpperCase(s.charAt(i))) {
				ans += Character.toLowerCase(s.charAt(i));
			}else if (Character.isLowerCase(s.charAt(i))) {
				ans += Character.toUpperCase(s.charAt(i));
			}else{
				ans += s.charAt(i);
			}
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			if (Character.isUpperCase(s.charAt(i))) {
				ans += Character.toLowerCase(s.charAt(i));
			}else if (Character.isLowerCase(s.charAt(i))) {
				ans += Character.toUpperCase(s.charAt(i));
			}else{
				ans += s.charAt(i);
			}
		} {
			if (Character.isUpperCase(s.charAt(i))) {
				ans += Character.toLowerCase(s.charAt(i));
			}else if (Character.isLowerCase(s.charAt(i))) {
				ans += Character.toUpperCase(s.charAt(i));
			}else{
				ans += s.charAt(i);
			}
		} if (Character.isUpperCase(s.charAt(i))) {
				ans += Character.toLowerCase(s.charAt(i));
			}else if (Character.isLowerCase(s.charAt(i))) {
				ans += Character.toUpperCase(s.charAt(i));
			}else{
				ans += s.charAt(i);
			} Character.isUpperCase(s.charAt(i)) Character.isUpperCase Character s.charAt(i) s.charAt s i {
				ans += Character.toLowerCase(s.charAt(i));
			} ans += Character.toLowerCase(s.charAt(i)) ans Character.toLowerCase(s.charAt(i)) Character.toLowerCase Character s.charAt(i) s.charAt s i if (Character.isLowerCase(s.charAt(i))) {
				ans += Character.toUpperCase(s.charAt(i));
			}else{
				ans += s.charAt(i);
			} Character.isLowerCase(s.charAt(i)) Character.isLowerCase Character s.charAt(i) s.charAt s i {
				ans += Character.toUpperCase(s.charAt(i));
			} ans += Character.toUpperCase(s.charAt(i)) ans Character.toUpperCase(s.charAt(i)) Character.toUpperCase Character s.charAt(i) s.charAt s i {
				ans += s.charAt(i);
			} ans += s.charAt(i) ans s.charAt(i) s.charAt s i System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		String s = stdIn.nextLine();
		String ans = "";
		for (int i=0; i<s.length(); i++) {
			if (Character.isUpperCase(s.charAt(i))) {
				ans += Character.toLowerCase(s.charAt(i));
			}else if (Character.isLowerCase(s.charAt(i))) {
				ans += Character.toUpperCase(s.charAt(i));
			}else{
				ans += s.charAt(i);
			}
		}
		System.out.println(ans);
	}
}