public class Main {

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

		char[] data = sc.nextLine().toCharArray();

//		System.out.println(data);
//		System.out.println(data[0]);
//		System.out.println(data[1]);
//		System.out.println(data[2]);
//		System.out.println(data[3]);
//		System.out.println(data[4]);

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

		System.out.println(data);
	}

} public class Main {

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

		char[] data = sc.nextLine().toCharArray();

//		System.out.println(data);
//		System.out.println(data[0]);
//		System.out.println(data[1]);
//		System.out.println(data[2]);
//		System.out.println(data[3]);
//		System.out.println(data[4]);

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

		System.out.println(data);
	}

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

		char[] data = sc.nextLine().toCharArray();

//		System.out.println(data);
//		System.out.println(data[0]);
//		System.out.println(data[1]);
//		System.out.println(data[2]);
//		System.out.println(data[3]);
//		System.out.println(data[4]);

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

		System.out.println(data);
	} main {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);

		char[] data = sc.nextLine().toCharArray();

//		System.out.println(data);
//		System.out.println(data[0]);
//		System.out.println(data[1]);
//		System.out.println(data[2]);
//		System.out.println(data[3]);
//		System.out.println(data[4]);

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

		System.out.println(data);
	} java.util.Scanner sc = new java.util.Scanner(System.in); sc new java.util.Scanner(System.in) char[] data = sc.nextLine().toCharArray(); data sc.nextLine().toCharArray() sc.nextLine().toCharArray sc.nextLine() sc.nextLine sc for (int i=0; i < data.length; i++) {
			if ( Character.isUpperCase(data[i]) ) {
				data[i] = Character.toLowerCase(data[i]);
			} else if ( Character.isLowerCase(data[i]) ) {
				data[i] = Character.toUpperCase(data[i]);
			}
		} int i=0; int i=0; i 0 i < data.length i data.length data data.length i++ i++ i {
			if ( Character.isUpperCase(data[i]) ) {
				data[i] = Character.toLowerCase(data[i]);
			} else if ( Character.isLowerCase(data[i]) ) {
				data[i] = Character.toUpperCase(data[i]);
			}
		} {
			if ( Character.isUpperCase(data[i]) ) {
				data[i] = Character.toLowerCase(data[i]);
			} else if ( Character.isLowerCase(data[i]) ) {
				data[i] = Character.toUpperCase(data[i]);
			}
		} if ( Character.isUpperCase(data[i]) ) {
				data[i] = Character.toLowerCase(data[i]);
			} else if ( Character.isLowerCase(data[i]) ) {
				data[i] = Character.toUpperCase(data[i]);
			} Character.isUpperCase(data[i]) Character.isUpperCase Character data[i] data i {
				data[i] = Character.toLowerCase(data[i]);
			} data[i] = Character.toLowerCase(data[i]) data[i] data i Character.toLowerCase(data[i]) Character.toLowerCase Character data[i] data i if ( Character.isLowerCase(data[i]) ) {
				data[i] = Character.toUpperCase(data[i]);
			} Character.isLowerCase(data[i]) Character.isLowerCase Character data[i] data i {
				data[i] = Character.toUpperCase(data[i]);
			} data[i] = Character.toUpperCase(data[i]) data[i] data i Character.toUpperCase(data[i]) Character.toUpperCase Character data[i] data i System.out.println(data) System.out.println System.out System System.out data String[] args args public class Main {

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

		char[] data = sc.nextLine().toCharArray();

//		System.out.println(data);
//		System.out.println(data[0]);
//		System.out.println(data[1]);
//		System.out.println(data[2]);
//		System.out.println(data[3]);
//		System.out.println(data[4]);

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

		System.out.println(data);
	}

} public class Main {

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

		char[] data = sc.nextLine().toCharArray();

//		System.out.println(data);
//		System.out.println(data[0]);
//		System.out.println(data[1]);
//		System.out.println(data[2]);
//		System.out.println(data[3]);
//		System.out.println(data[4]);

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

		System.out.println(data);
	}

} Main
public class Main {

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

		char[] data = sc.nextLine().toCharArray();

//		System.out.println(data);
//		System.out.println(data[0]);
//		System.out.println(data[1]);
//		System.out.println(data[2]);
//		System.out.println(data[3]);
//		System.out.println(data[4]);

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

		System.out.println(data);
	}

}