import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		char[] chars = str.toCharArray();

		chars = switch_ul(chars);

		for (int i = 0; i < chars.length; i++) {
			System.out.print(chars[i]);
		}

		System.out.println();
		sc.close();


	}

	private static char[] switch_ul(char[] chars) {
		char[] chars_switch = new char[chars.length];

		for (int i = 0; i < chars.length; i++) {
			if(Character.isUpperCase(chars[i]) ) {
				chars_switch[i] = Character.toLowerCase(chars[i]);
			} else if (Character.isLowerCase(chars[i])) {
				chars_switch[i] = Character.toUpperCase(chars[i]);
			} else {
				chars_switch[i] = chars[i];
			}
		}

		return chars_switch;
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		char[] chars = str.toCharArray();

		chars = switch_ul(chars);

		for (int i = 0; i < chars.length; i++) {
			System.out.print(chars[i]);
		}

		System.out.println();
		sc.close();


	}

	private static char[] switch_ul(char[] chars) {
		char[] chars_switch = new char[chars.length];

		for (int i = 0; i < chars.length; i++) {
			if(Character.isUpperCase(chars[i]) ) {
				chars_switch[i] = Character.toLowerCase(chars[i]);
			} else if (Character.isLowerCase(chars[i])) {
				chars_switch[i] = Character.toUpperCase(chars[i]);
			} else {
				chars_switch[i] = chars[i];
			}
		}

		return chars_switch;
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		char[] chars = str.toCharArray();

		chars = switch_ul(chars);

		for (int i = 0; i < chars.length; i++) {
			System.out.print(chars[i]);
		}

		System.out.println();
		sc.close();


	} main {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		char[] chars = str.toCharArray();

		chars = switch_ul(chars);

		for (int i = 0; i < chars.length; i++) {
			System.out.print(chars[i]);
		}

		System.out.println();
		sc.close();


	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc char[] chars = str.toCharArray(); chars str.toCharArray() str.toCharArray str chars = switch_ul(chars) chars switch_ul(chars) switch_ul chars for (int i = 0; i < chars.length; i++) {
			System.out.print(chars[i]);
		} int i = 0; int i = 0; i 0 i < chars.length i chars.length chars chars.length i++ i++ i {
			System.out.print(chars[i]);
		} {
			System.out.print(chars[i]);
		} System.out.print(chars[i]) System.out.print System.out System System.out chars[i] chars i System.out.println() System.out.println System.out System System.out sc.close() sc.close sc String[] args args private static char[] switch_ul(char[] chars) {
		char[] chars_switch = new char[chars.length];

		for (int i = 0; i < chars.length; i++) {
			if(Character.isUpperCase(chars[i]) ) {
				chars_switch[i] = Character.toLowerCase(chars[i]);
			} else if (Character.isLowerCase(chars[i])) {
				chars_switch[i] = Character.toUpperCase(chars[i]);
			} else {
				chars_switch[i] = chars[i];
			}
		}

		return chars_switch;
	} switch_ul {
		char[] chars_switch = new char[chars.length];

		for (int i = 0; i < chars.length; i++) {
			if(Character.isUpperCase(chars[i]) ) {
				chars_switch[i] = Character.toLowerCase(chars[i]);
			} else if (Character.isLowerCase(chars[i])) {
				chars_switch[i] = Character.toUpperCase(chars[i]);
			} else {
				chars_switch[i] = chars[i];
			}
		}

		return chars_switch;
	} char[] chars_switch = new char[chars.length]; chars_switch new char[chars.length] chars.length chars chars.length for (int i = 0; i < chars.length; i++) {
			if(Character.isUpperCase(chars[i]) ) {
				chars_switch[i] = Character.toLowerCase(chars[i]);
			} else if (Character.isLowerCase(chars[i])) {
				chars_switch[i] = Character.toUpperCase(chars[i]);
			} else {
				chars_switch[i] = chars[i];
			}
		} int i = 0; int i = 0; i 0 i < chars.length i chars.length chars chars.length i++ i++ i {
			if(Character.isUpperCase(chars[i]) ) {
				chars_switch[i] = Character.toLowerCase(chars[i]);
			} else if (Character.isLowerCase(chars[i])) {
				chars_switch[i] = Character.toUpperCase(chars[i]);
			} else {
				chars_switch[i] = chars[i];
			}
		} {
			if(Character.isUpperCase(chars[i]) ) {
				chars_switch[i] = Character.toLowerCase(chars[i]);
			} else if (Character.isLowerCase(chars[i])) {
				chars_switch[i] = Character.toUpperCase(chars[i]);
			} else {
				chars_switch[i] = chars[i];
			}
		} if(Character.isUpperCase(chars[i]) ) {
				chars_switch[i] = Character.toLowerCase(chars[i]);
			} else if (Character.isLowerCase(chars[i])) {
				chars_switch[i] = Character.toUpperCase(chars[i]);
			} else {
				chars_switch[i] = chars[i];
			} Character.isUpperCase(chars[i]) Character.isUpperCase Character chars[i] chars i {
				chars_switch[i] = Character.toLowerCase(chars[i]);
			} chars_switch[i] = Character.toLowerCase(chars[i]) chars_switch[i] chars_switch i Character.toLowerCase(chars[i]) Character.toLowerCase Character chars[i] chars i if (Character.isLowerCase(chars[i])) {
				chars_switch[i] = Character.toUpperCase(chars[i]);
			} else {
				chars_switch[i] = chars[i];
			} Character.isLowerCase(chars[i]) Character.isLowerCase Character chars[i] chars i {
				chars_switch[i] = Character.toUpperCase(chars[i]);
			} chars_switch[i] = Character.toUpperCase(chars[i]) chars_switch[i] chars_switch i Character.toUpperCase(chars[i]) Character.toUpperCase Character chars[i] chars i {
				chars_switch[i] = chars[i];
			} chars_switch[i] = chars[i] chars_switch[i] chars_switch i chars[i] chars i return chars_switch; chars_switch char[] chars chars public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		char[] chars = str.toCharArray();

		chars = switch_ul(chars);

		for (int i = 0; i < chars.length; i++) {
			System.out.print(chars[i]);
		}

		System.out.println();
		sc.close();


	}

	private static char[] switch_ul(char[] chars) {
		char[] chars_switch = new char[chars.length];

		for (int i = 0; i < chars.length; i++) {
			if(Character.isUpperCase(chars[i]) ) {
				chars_switch[i] = Character.toLowerCase(chars[i]);
			} else if (Character.isLowerCase(chars[i])) {
				chars_switch[i] = Character.toUpperCase(chars[i]);
			} else {
				chars_switch[i] = chars[i];
			}
		}

		return chars_switch;
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		char[] chars = str.toCharArray();

		chars = switch_ul(chars);

		for (int i = 0; i < chars.length; i++) {
			System.out.print(chars[i]);
		}

		System.out.println();
		sc.close();


	}

	private static char[] switch_ul(char[] chars) {
		char[] chars_switch = new char[chars.length];

		for (int i = 0; i < chars.length; i++) {
			if(Character.isUpperCase(chars[i]) ) {
				chars_switch[i] = Character.toLowerCase(chars[i]);
			} else if (Character.isLowerCase(chars[i])) {
				chars_switch[i] = Character.toUpperCase(chars[i]);
			} else {
				chars_switch[i] = chars[i];
			}
		}

		return chars_switch;
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		char[] chars = str.toCharArray();

		chars = switch_ul(chars);

		for (int i = 0; i < chars.length; i++) {
			System.out.print(chars[i]);
		}

		System.out.println();
		sc.close();


	}

	private static char[] switch_ul(char[] chars) {
		char[] chars_switch = new char[chars.length];

		for (int i = 0; i < chars.length; i++) {
			if(Character.isUpperCase(chars[i]) ) {
				chars_switch[i] = Character.toLowerCase(chars[i]);
			} else if (Character.isLowerCase(chars[i])) {
				chars_switch[i] = Character.toUpperCase(chars[i]);
			} else {
				chars_switch[i] = chars[i];
			}
		}

		return chars_switch;
	}

}

