import java.util.Scanner;

public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		
		StringBuilder r = new StringBuilder();
		for (int i = 0; i < line.length(); i++) {

			if (Character.isUpperCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toLowerCase()));
			} else if (Character.isLowerCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toUpperCase()));
			} else {
				r.append(String.valueOf(line.substring(i, i + 1)));
			}

		}
		System.out.println(r);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		
		StringBuilder r = new StringBuilder();
		for (int i = 0; i < line.length(); i++) {

			if (Character.isUpperCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toLowerCase()));
			} else if (Character.isLowerCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toUpperCase()));
			} else {
				r.append(String.valueOf(line.substring(i, i + 1)));
			}

		}
		System.out.println(r);
	}
} Main public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		
		StringBuilder r = new StringBuilder();
		for (int i = 0; i < line.length(); i++) {

			if (Character.isUpperCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toLowerCase()));
			} else if (Character.isLowerCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toUpperCase()));
			} else {
				r.append(String.valueOf(line.substring(i, i + 1)));
			}

		}
		System.out.println(r);
	} main {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		
		StringBuilder r = new StringBuilder();
		for (int i = 0; i < line.length(); i++) {

			if (Character.isUpperCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toLowerCase()));
			} else if (Character.isLowerCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toUpperCase()));
			} else {
				r.append(String.valueOf(line.substring(i, i + 1)));
			}

		}
		System.out.println(r);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc StringBuilder r = new StringBuilder(); r new StringBuilder() for (int i = 0; i < line.length(); i++) {

			if (Character.isUpperCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toLowerCase()));
			} else if (Character.isLowerCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toUpperCase()));
			} else {
				r.append(String.valueOf(line.substring(i, i + 1)));
			}

		} int i = 0; int i = 0; i 0 i < line.length() i line.length() line.length line i++ i++ i {

			if (Character.isUpperCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toLowerCase()));
			} else if (Character.isLowerCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toUpperCase()));
			} else {
				r.append(String.valueOf(line.substring(i, i + 1)));
			}

		} {

			if (Character.isUpperCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toLowerCase()));
			} else if (Character.isLowerCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toUpperCase()));
			} else {
				r.append(String.valueOf(line.substring(i, i + 1)));
			}

		} if (Character.isUpperCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toLowerCase()));
			} else if (Character.isLowerCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toUpperCase()));
			} else {
				r.append(String.valueOf(line.substring(i, i + 1)));
			} Character.isUpperCase(line.charAt(i)) Character.isUpperCase Character line.charAt(i) line.charAt line i {
				r.append(String.valueOf(line.substring(i, i + 1).toLowerCase()));
			} r.append(String.valueOf(line.substring(i, i + 1).toLowerCase())) r.append r String.valueOf(line.substring(i, i + 1).toLowerCase()) String.valueOf String line.substring(i, i + 1).toLowerCase() line.substring(i, i + 1).toLowerCase line.substring(i, i + 1) line.substring line i i + 1 i 1 if (Character.isLowerCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toUpperCase()));
			} else {
				r.append(String.valueOf(line.substring(i, i + 1)));
			} Character.isLowerCase(line.charAt(i)) Character.isLowerCase Character line.charAt(i) line.charAt line i {
				r.append(String.valueOf(line.substring(i, i + 1).toUpperCase()));
			} r.append(String.valueOf(line.substring(i, i + 1).toUpperCase())) r.append r String.valueOf(line.substring(i, i + 1).toUpperCase()) String.valueOf String line.substring(i, i + 1).toUpperCase() line.substring(i, i + 1).toUpperCase line.substring(i, i + 1) line.substring line i i + 1 i 1 {
				r.append(String.valueOf(line.substring(i, i + 1)));
			} r.append(String.valueOf(line.substring(i, i + 1))) r.append r String.valueOf(line.substring(i, i + 1)) String.valueOf String line.substring(i, i + 1) line.substring line i i + 1 i 1 System.out.println(r) System.out.println System.out System System.out r String[] arges arges public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		
		StringBuilder r = new StringBuilder();
		for (int i = 0; i < line.length(); i++) {

			if (Character.isUpperCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toLowerCase()));
			} else if (Character.isLowerCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toUpperCase()));
			} else {
				r.append(String.valueOf(line.substring(i, i + 1)));
			}

		}
		System.out.println(r);
	}
} public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		
		StringBuilder r = new StringBuilder();
		for (int i = 0; i < line.length(); i++) {

			if (Character.isUpperCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toLowerCase()));
			} else if (Character.isLowerCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toUpperCase()));
			} else {
				r.append(String.valueOf(line.substring(i, i + 1)));
			}

		}
		System.out.println(r);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		
		StringBuilder r = new StringBuilder();
		for (int i = 0; i < line.length(); i++) {

			if (Character.isUpperCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toLowerCase()));
			} else if (Character.isLowerCase(line.charAt(i))) {
				r.append(String.valueOf(line.substring(i, i + 1).toUpperCase()));
			} else {
				r.append(String.valueOf(line.substring(i, i + 1)));
			}

		}
		System.out.println(r);
	}
}