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

public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String str = in.readLine();
		short size = (short) str.length();
		char[] charStr = str.toCharArray();
		for (int i = 0; i < size; i += 1) {
			if (Character.isLowerCase(charStr[i])) {
				charStr[i] = Character.toUpperCase(charStr[i]);
			} else if (Character.isUpperCase(charStr[i])) {
				charStr[i] = Character.toLowerCase(charStr[i]);
			}
		}
		System.out.println(charStr);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String str = in.readLine();
		short size = (short) str.length();
		char[] charStr = str.toCharArray();
		for (int i = 0; i < size; i += 1) {
			if (Character.isLowerCase(charStr[i])) {
				charStr[i] = Character.toUpperCase(charStr[i]);
			} else if (Character.isUpperCase(charStr[i])) {
				charStr[i] = Character.toLowerCase(charStr[i]);
			}
		}
		System.out.println(charStr);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String str = in.readLine();
		short size = (short) str.length();
		char[] charStr = str.toCharArray();
		for (int i = 0; i < size; i += 1) {
			if (Character.isLowerCase(charStr[i])) {
				charStr[i] = Character.toUpperCase(charStr[i]);
			} else if (Character.isUpperCase(charStr[i])) {
				charStr[i] = Character.toLowerCase(charStr[i]);
			}
		}
		System.out.println(charStr);
	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String str = in.readLine();
		short size = (short) str.length();
		char[] charStr = str.toCharArray();
		for (int i = 0; i < size; i += 1) {
			if (Character.isLowerCase(charStr[i])) {
				charStr[i] = Character.toUpperCase(charStr[i]);
			} else if (Character.isUpperCase(charStr[i])) {
				charStr[i] = Character.toLowerCase(charStr[i]);
			}
		}
		System.out.println(charStr);
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String str = in.readLine(); str in.readLine() in.readLine in short size = (short) str.length(); size (short) str.length() str.length str char[] charStr = str.toCharArray(); charStr str.toCharArray() str.toCharArray str for (int i = 0; i < size; i += 1) {
			if (Character.isLowerCase(charStr[i])) {
				charStr[i] = Character.toUpperCase(charStr[i]);
			} else if (Character.isUpperCase(charStr[i])) {
				charStr[i] = Character.toLowerCase(charStr[i]);
			}
		} int i = 0; int i = 0; i 0 i < size i size i += 1 i += 1 i 1 {
			if (Character.isLowerCase(charStr[i])) {
				charStr[i] = Character.toUpperCase(charStr[i]);
			} else if (Character.isUpperCase(charStr[i])) {
				charStr[i] = Character.toLowerCase(charStr[i]);
			}
		} {
			if (Character.isLowerCase(charStr[i])) {
				charStr[i] = Character.toUpperCase(charStr[i]);
			} else if (Character.isUpperCase(charStr[i])) {
				charStr[i] = Character.toLowerCase(charStr[i]);
			}
		} if (Character.isLowerCase(charStr[i])) {
				charStr[i] = Character.toUpperCase(charStr[i]);
			} else if (Character.isUpperCase(charStr[i])) {
				charStr[i] = Character.toLowerCase(charStr[i]);
			} Character.isLowerCase(charStr[i]) Character.isLowerCase Character charStr[i] charStr i {
				charStr[i] = Character.toUpperCase(charStr[i]);
			} charStr[i] = Character.toUpperCase(charStr[i]) charStr[i] charStr i Character.toUpperCase(charStr[i]) Character.toUpperCase Character charStr[i] charStr i if (Character.isUpperCase(charStr[i])) {
				charStr[i] = Character.toLowerCase(charStr[i]);
			} Character.isUpperCase(charStr[i]) Character.isUpperCase Character charStr[i] charStr i {
				charStr[i] = Character.toLowerCase(charStr[i]);
			} charStr[i] = Character.toLowerCase(charStr[i]) charStr[i] charStr i Character.toLowerCase(charStr[i]) Character.toLowerCase Character charStr[i] charStr i System.out.println(charStr) System.out.println System.out System System.out charStr String[] args args public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String str = in.readLine();
		short size = (short) str.length();
		char[] charStr = str.toCharArray();
		for (int i = 0; i < size; i += 1) {
			if (Character.isLowerCase(charStr[i])) {
				charStr[i] = Character.toUpperCase(charStr[i]);
			} else if (Character.isUpperCase(charStr[i])) {
				charStr[i] = Character.toLowerCase(charStr[i]);
			}
		}
		System.out.println(charStr);
	}
} public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String str = in.readLine();
		short size = (short) str.length();
		char[] charStr = str.toCharArray();
		for (int i = 0; i < size; i += 1) {
			if (Character.isLowerCase(charStr[i])) {
				charStr[i] = Character.toUpperCase(charStr[i]);
			} else if (Character.isUpperCase(charStr[i])) {
				charStr[i] = Character.toLowerCase(charStr[i]);
			}
		}
		System.out.println(charStr);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String str = in.readLine();
		short size = (short) str.length();
		char[] charStr = str.toCharArray();
		for (int i = 0; i < size; i += 1) {
			if (Character.isLowerCase(charStr[i])) {
				charStr[i] = Character.toUpperCase(charStr[i]);
			} else if (Character.isUpperCase(charStr[i])) {
				charStr[i] = Character.toLowerCase(charStr[i]);
			}
		}
		System.out.println(charStr);
	}
}