import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String input = br.readLine();
			int i;
			String ret = "";
			for (i = 0; i < input.length(); i++) {
				String c = input.substring(i, i + 1);
				if (c == c.toLowerCase()) {
					ret = ret + c.toUpperCase();
				} else {
					ret = ret + c.toLowerCase();
				}
			}
			System.out.println(ret);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {
	public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String input = br.readLine();
			int i;
			String ret = "";
			for (i = 0; i < input.length(); i++) {
				String c = input.substring(i, i + 1);
				if (c == c.toLowerCase()) {
					ret = ret + c.toUpperCase();
				} else {
					ret = ret + c.toLowerCase();
				}
			}
			System.out.println(ret);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} Main public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String input = br.readLine();
			int i;
			String ret = "";
			for (i = 0; i < input.length(); i++) {
				String c = input.substring(i, i + 1);
				if (c == c.toLowerCase()) {
					ret = ret + c.toUpperCase();
				} else {
					ret = ret + c.toLowerCase();
				}
			}
			System.out.println(ret);
		} catch (IOException e) {
			e.printStackTrace();
		}
	} main {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String input = br.readLine();
			int i;
			String ret = "";
			for (i = 0; i < input.length(); i++) {
				String c = input.substring(i, i + 1);
				if (c == c.toLowerCase()) {
					ret = ret + c.toUpperCase();
				} else {
					ret = ret + c.toLowerCase();
				}
			}
			System.out.println(ret);
		} catch (IOException e) {
			e.printStackTrace();
		}
	} InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) try {
			String input = br.readLine();
			int i;
			String ret = "";
			for (i = 0; i < input.length(); i++) {
				String c = input.substring(i, i + 1);
				if (c == c.toLowerCase()) {
					ret = ret + c.toUpperCase();
				} else {
					ret = ret + c.toLowerCase();
				}
			}
			System.out.println(ret);
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			String input = br.readLine();
			int i;
			String ret = "";
			for (i = 0; i < input.length(); i++) {
				String c = input.substring(i, i + 1);
				if (c == c.toLowerCase()) {
					ret = ret + c.toUpperCase();
				} else {
					ret = ret + c.toLowerCase();
				}
			}
			System.out.println(ret);
		} String input = br.readLine(); input br.readLine() br.readLine br int i; i String ret = ""; ret "" for (i = 0; i < input.length(); i++) {
				String c = input.substring(i, i + 1);
				if (c == c.toLowerCase()) {
					ret = ret + c.toUpperCase();
				} else {
					ret = ret + c.toLowerCase();
				}
			} i = 0; i = 0 i 0 i < input.length() i input.length() input.length input i++ i++ i {
				String c = input.substring(i, i + 1);
				if (c == c.toLowerCase()) {
					ret = ret + c.toUpperCase();
				} else {
					ret = ret + c.toLowerCase();
				}
			} {
				String c = input.substring(i, i + 1);
				if (c == c.toLowerCase()) {
					ret = ret + c.toUpperCase();
				} else {
					ret = ret + c.toLowerCase();
				}
			} String c = input.substring(i, i + 1); c input.substring(i, i + 1) input.substring input i i + 1 i 1 if (c == c.toLowerCase()) {
					ret = ret + c.toUpperCase();
				} else {
					ret = ret + c.toLowerCase();
				} c == c.toLowerCase() c c.toLowerCase() c.toLowerCase c {
					ret = ret + c.toUpperCase();
				} ret = ret + c.toUpperCase() ret ret + c.toUpperCase() ret c.toUpperCase() c.toUpperCase c {
					ret = ret + c.toLowerCase();
				} ret = ret + c.toLowerCase() ret ret + c.toLowerCase() ret c.toLowerCase() c.toLowerCase c System.out.println(ret) System.out.println System.out System System.out ret String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String input = br.readLine();
			int i;
			String ret = "";
			for (i = 0; i < input.length(); i++) {
				String c = input.substring(i, i + 1);
				if (c == c.toLowerCase()) {
					ret = ret + c.toUpperCase();
				} else {
					ret = ret + c.toLowerCase();
				}
			}
			System.out.println(ret);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}