import java.util.Scanner;

public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		String[] strarray = str.split(" ");
		for(int i = 0; i < strarray.length; i++) {
			char[] carray = strarray[i].toCharArray();
			for (char c : carray) {
				if (Character.isUpperCase(c)) {
					c = Character.toLowerCase(c);
				} else if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				}
				System.out.print(c);
			}
			if (i != strarray.length - 1)System.out.print(" ");
		}
		System.out.println();
	}
	public static void main(String[] args) {
		new Main().run();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		String[] strarray = str.split(" ");
		for(int i = 0; i < strarray.length; i++) {
			char[] carray = strarray[i].toCharArray();
			for (char c : carray) {
				if (Character.isUpperCase(c)) {
					c = Character.toLowerCase(c);
				} else if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				}
				System.out.print(c);
			}
			if (i != strarray.length - 1)System.out.print(" ");
		}
		System.out.println();
	}
	public static void main(String[] args) {
		new Main().run();
	}
} Main void run() {
		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		String[] strarray = str.split(" ");
		for(int i = 0; i < strarray.length; i++) {
			char[] carray = strarray[i].toCharArray();
			for (char c : carray) {
				if (Character.isUpperCase(c)) {
					c = Character.toLowerCase(c);
				} else if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				}
				System.out.print(c);
			}
			if (i != strarray.length - 1)System.out.print(" ");
		}
		System.out.println();
	} run {
		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		String[] strarray = str.split(" ");
		for(int i = 0; i < strarray.length; i++) {
			char[] carray = strarray[i].toCharArray();
			for (char c : carray) {
				if (Character.isUpperCase(c)) {
					c = Character.toLowerCase(c);
				} else if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				}
				System.out.print(c);
			}
			if (i != strarray.length - 1)System.out.print(" ");
		}
		System.out.println();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String str = scan.nextLine(); str scan.nextLine() scan.nextLine scan String[] strarray = str.split(" "); strarray str.split(" ") str.split str " " for(int i = 0; i < strarray.length; i++) {
			char[] carray = strarray[i].toCharArray();
			for (char c : carray) {
				if (Character.isUpperCase(c)) {
					c = Character.toLowerCase(c);
				} else if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				}
				System.out.print(c);
			}
			if (i != strarray.length - 1)System.out.print(" ");
		} int i = 0; int i = 0; i 0 i < strarray.length i strarray.length strarray strarray.length i++ i++ i {
			char[] carray = strarray[i].toCharArray();
			for (char c : carray) {
				if (Character.isUpperCase(c)) {
					c = Character.toLowerCase(c);
				} else if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				}
				System.out.print(c);
			}
			if (i != strarray.length - 1)System.out.print(" ");
		} {
			char[] carray = strarray[i].toCharArray();
			for (char c : carray) {
				if (Character.isUpperCase(c)) {
					c = Character.toLowerCase(c);
				} else if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				}
				System.out.print(c);
			}
			if (i != strarray.length - 1)System.out.print(" ");
		} char[] carray = strarray[i].toCharArray(); carray strarray[i].toCharArray() strarray[i].toCharArray strarray[i] strarray i for (char c : carray) {
				if (Character.isUpperCase(c)) {
					c = Character.toLowerCase(c);
				} else if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				}
				System.out.print(c);
			} char c carray {
				if (Character.isUpperCase(c)) {
					c = Character.toLowerCase(c);
				} else if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				}
				System.out.print(c);
			} {
				if (Character.isUpperCase(c)) {
					c = Character.toLowerCase(c);
				} else if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				}
				System.out.print(c);
			} if (Character.isUpperCase(c)) {
					c = Character.toLowerCase(c);
				} else if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				} Character.isUpperCase(c) Character.isUpperCase Character c {
					c = Character.toLowerCase(c);
				} c = Character.toLowerCase(c) c Character.toLowerCase(c) Character.toLowerCase Character c if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				} Character.isLowerCase(c) Character.isLowerCase Character c {
					c = Character.toUpperCase(c);
				} c = Character.toUpperCase(c) c Character.toUpperCase(c) Character.toUpperCase Character c System.out.print(c) System.out.print System.out System System.out c if (i != strarray.length - 1)System.out.print(" "); i != strarray.length - 1 i strarray.length - 1 strarray.length strarray strarray.length 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out public static void main(String[] args) {
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String[] args args public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		String[] strarray = str.split(" ");
		for(int i = 0; i < strarray.length; i++) {
			char[] carray = strarray[i].toCharArray();
			for (char c : carray) {
				if (Character.isUpperCase(c)) {
					c = Character.toLowerCase(c);
				} else if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				}
				System.out.print(c);
			}
			if (i != strarray.length - 1)System.out.print(" ");
		}
		System.out.println();
	}
	public static void main(String[] args) {
		new Main().run();
	}
} public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		String[] strarray = str.split(" ");
		for(int i = 0; i < strarray.length; i++) {
			char[] carray = strarray[i].toCharArray();
			for (char c : carray) {
				if (Character.isUpperCase(c)) {
					c = Character.toLowerCase(c);
				} else if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				}
				System.out.print(c);
			}
			if (i != strarray.length - 1)System.out.print(" ");
		}
		System.out.println();
	}
	public static void main(String[] args) {
		new Main().run();
	}
} Main
import java.util.Scanner;

public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		String[] strarray = str.split(" ");
		for(int i = 0; i < strarray.length; i++) {
			char[] carray = strarray[i].toCharArray();
			for (char c : carray) {
				if (Character.isUpperCase(c)) {
					c = Character.toLowerCase(c);
				} else if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				}
				System.out.print(c);
			}
			if (i != strarray.length - 1)System.out.print(" ");
		}
		System.out.println();
	}
	public static void main(String[] args) {
		new Main().run();
	}
}