import java.util.Scanner;

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

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