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));
		StringBuilder sb = new StringBuilder();
		String[] str = in.readLine().split("");
		short size = (short) str.length;
		for (int i = 1; i < size; i += 1) {
			if (str[i].matches("[a-z]")) {
				sb.append(str[i].toUpperCase());
			} else if (str[i].matches("[A-Z]")) {
				sb.append(str[i].toLowerCase());
			} else {
				sb.append(str[i]);
			}
		}
		System.out.println(sb);
	}
} 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));
		StringBuilder sb = new StringBuilder();
		String[] str = in.readLine().split("");
		short size = (short) str.length;
		for (int i = 1; i < size; i += 1) {
			if (str[i].matches("[a-z]")) {
				sb.append(str[i].toUpperCase());
			} else if (str[i].matches("[A-Z]")) {
				sb.append(str[i].toLowerCase());
			} else {
				sb.append(str[i]);
			}
		}
		System.out.println(sb);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] str = in.readLine().split("");
		short size = (short) str.length;
		for (int i = 1; i < size; i += 1) {
			if (str[i].matches("[a-z]")) {
				sb.append(str[i].toUpperCase());
			} else if (str[i].matches("[A-Z]")) {
				sb.append(str[i].toLowerCase());
			} else {
				sb.append(str[i]);
			}
		}
		System.out.println(sb);
	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] str = in.readLine().split("");
		short size = (short) str.length;
		for (int i = 1; i < size; i += 1) {
			if (str[i].matches("[a-z]")) {
				sb.append(str[i].toUpperCase());
			} else if (str[i].matches("[A-Z]")) {
				sb.append(str[i].toLowerCase());
			} else {
				sb.append(str[i]);
			}
		}
		System.out.println(sb);
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() String[] str = in.readLine().split(""); str in.readLine().split("") in.readLine().split in.readLine() in.readLine in "" short size = (short) str.length; size (short) str.length str str.length for (int i = 1; i < size; i += 1) {
			if (str[i].matches("[a-z]")) {
				sb.append(str[i].toUpperCase());
			} else if (str[i].matches("[A-Z]")) {
				sb.append(str[i].toLowerCase());
			} else {
				sb.append(str[i]);
			}
		} int i = 1; int i = 1; i 1 i < size i size i += 1 i += 1 i 1 {
			if (str[i].matches("[a-z]")) {
				sb.append(str[i].toUpperCase());
			} else if (str[i].matches("[A-Z]")) {
				sb.append(str[i].toLowerCase());
			} else {
				sb.append(str[i]);
			}
		} {
			if (str[i].matches("[a-z]")) {
				sb.append(str[i].toUpperCase());
			} else if (str[i].matches("[A-Z]")) {
				sb.append(str[i].toLowerCase());
			} else {
				sb.append(str[i]);
			}
		} if (str[i].matches("[a-z]")) {
				sb.append(str[i].toUpperCase());
			} else if (str[i].matches("[A-Z]")) {
				sb.append(str[i].toLowerCase());
			} else {
				sb.append(str[i]);
			} str[i].matches("[a-z]") str[i].matches str[i] str i "[a-z]" {
				sb.append(str[i].toUpperCase());
			} sb.append(str[i].toUpperCase()) sb.append sb str[i].toUpperCase() str[i].toUpperCase str[i] str i if (str[i].matches("[A-Z]")) {
				sb.append(str[i].toLowerCase());
			} else {
				sb.append(str[i]);
			} str[i].matches("[A-Z]") str[i].matches str[i] str i "[A-Z]" {
				sb.append(str[i].toLowerCase());
			} sb.append(str[i].toLowerCase()) sb.append sb str[i].toLowerCase() str[i].toLowerCase str[i] str i {
				sb.append(str[i]);
			} sb.append(str[i]) sb.append sb str[i] str i System.out.println(sb) System.out.println System.out System System.out sb String[] args args public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] str = in.readLine().split("");
		short size = (short) str.length;
		for (int i = 1; i < size; i += 1) {
			if (str[i].matches("[a-z]")) {
				sb.append(str[i].toUpperCase());
			} else if (str[i].matches("[A-Z]")) {
				sb.append(str[i].toLowerCase());
			} else {
				sb.append(str[i]);
			}
		}
		System.out.println(sb);
	}
} public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] str = in.readLine().split("");
		short size = (short) str.length;
		for (int i = 1; i < size; i += 1) {
			if (str[i].matches("[a-z]")) {
				sb.append(str[i].toUpperCase());
			} else if (str[i].matches("[A-Z]")) {
				sb.append(str[i].toLowerCase());
			} else {
				sb.append(str[i]);
			}
		}
		System.out.println(sb);
	}
} 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));
		StringBuilder sb = new StringBuilder();
		String[] str = in.readLine().split("");
		short size = (short) str.length;
		for (int i = 1; i < size; i += 1) {
			if (str[i].matches("[a-z]")) {
				sb.append(str[i].toUpperCase());
			} else if (str[i].matches("[A-Z]")) {
				sb.append(str[i].toLowerCase());
			} else {
				sb.append(str[i]);
			}
		}
		System.out.println(sb);
	}
}