import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();

		StringBuilder answer = new StringBuilder();

		for (int i = 0; i < line.length(); i++) {
			String s = line.substring(i, i + 1);
			char cs = line.charAt(i);
			if (Character.isUpperCase(cs)) {
				answer.append(s.toLowerCase());
			} else {
				answer.append(s.toUpperCase());
			}

		}

		System.out.println(answer);

	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();

		StringBuilder answer = new StringBuilder();

		for (int i = 0; i < line.length(); i++) {
			String s = line.substring(i, i + 1);
			char cs = line.charAt(i);
			if (Character.isUpperCase(cs)) {
				answer.append(s.toLowerCase());
			} else {
				answer.append(s.toUpperCase());
			}

		}

		System.out.println(answer);

	}
} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();

		StringBuilder answer = new StringBuilder();

		for (int i = 0; i < line.length(); i++) {
			String s = line.substring(i, i + 1);
			char cs = line.charAt(i);
			if (Character.isUpperCase(cs)) {
				answer.append(s.toLowerCase());
			} else {
				answer.append(s.toUpperCase());
			}

		}

		System.out.println(answer);

	} main {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();

		StringBuilder answer = new StringBuilder();

		for (int i = 0; i < line.length(); i++) {
			String s = line.substring(i, i + 1);
			char cs = line.charAt(i);
			if (Character.isUpperCase(cs)) {
				answer.append(s.toLowerCase());
			} else {
				answer.append(s.toUpperCase());
			}

		}

		System.out.println(answer);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc StringBuilder answer = new StringBuilder(); answer new StringBuilder() for (int i = 0; i < line.length(); i++) {
			String s = line.substring(i, i + 1);
			char cs = line.charAt(i);
			if (Character.isUpperCase(cs)) {
				answer.append(s.toLowerCase());
			} else {
				answer.append(s.toUpperCase());
			}

		} int i = 0; int i = 0; i 0 i < line.length() i line.length() line.length line i++ i++ i {
			String s = line.substring(i, i + 1);
			char cs = line.charAt(i);
			if (Character.isUpperCase(cs)) {
				answer.append(s.toLowerCase());
			} else {
				answer.append(s.toUpperCase());
			}

		} {
			String s = line.substring(i, i + 1);
			char cs = line.charAt(i);
			if (Character.isUpperCase(cs)) {
				answer.append(s.toLowerCase());
			} else {
				answer.append(s.toUpperCase());
			}

		} String s = line.substring(i, i + 1); s line.substring(i, i + 1) line.substring line i i + 1 i 1 char cs = line.charAt(i); cs line.charAt(i) line.charAt line i if (Character.isUpperCase(cs)) {
				answer.append(s.toLowerCase());
			} else {
				answer.append(s.toUpperCase());
			} Character.isUpperCase(cs) Character.isUpperCase Character cs {
				answer.append(s.toLowerCase());
			} answer.append(s.toLowerCase()) answer.append answer s.toLowerCase() s.toLowerCase s {
				answer.append(s.toUpperCase());
			} answer.append(s.toUpperCase()) answer.append answer s.toUpperCase() s.toUpperCase s System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();

		StringBuilder answer = new StringBuilder();

		for (int i = 0; i < line.length(); i++) {
			String s = line.substring(i, i + 1);
			char cs = line.charAt(i);
			if (Character.isUpperCase(cs)) {
				answer.append(s.toLowerCase());
			} else {
				answer.append(s.toUpperCase());
			}

		}

		System.out.println(answer);

	}
} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();

		StringBuilder answer = new StringBuilder();

		for (int i = 0; i < line.length(); i++) {
			String s = line.substring(i, i + 1);
			char cs = line.charAt(i);
			if (Character.isUpperCase(cs)) {
				answer.append(s.toLowerCase());
			} else {
				answer.append(s.toUpperCase());
			}

		}

		System.out.println(answer);

	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();

		StringBuilder answer = new StringBuilder();

		for (int i = 0; i < line.length(); i++) {
			String s = line.substring(i, i + 1);
			char cs = line.charAt(i);
			if (Character.isUpperCase(cs)) {
				answer.append(s.toLowerCase());
			} else {
				answer.append(s.toUpperCase());
			}

		}

		System.out.println(answer);

	}
}