import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String input = sc.nextLine();
		sc.close();

		int sa = (int)'A' - (int)'a';

		for(char moji : input.toCharArray()) {
			if('a' <= moji && moji <= 'z') {
				System.out.print( (char)((int)moji + sa) );
			} else if('A' <= moji && moji <= 'Z') {
				System.out.print( (char)((int)moji - sa) );
			} else {
				System.out.print(moji);
			}
		}
		System.out.println();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String input = sc.nextLine();
		sc.close();

		int sa = (int)'A' - (int)'a';

		for(char moji : input.toCharArray()) {
			if('a' <= moji && moji <= 'z') {
				System.out.print( (char)((int)moji + sa) );
			} else if('A' <= moji && moji <= 'Z') {
				System.out.print( (char)((int)moji - sa) );
			} else {
				System.out.print(moji);
			}
		}
		System.out.println();
	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String input = sc.nextLine();
		sc.close();

		int sa = (int)'A' - (int)'a';

		for(char moji : input.toCharArray()) {
			if('a' <= moji && moji <= 'z') {
				System.out.print( (char)((int)moji + sa) );
			} else if('A' <= moji && moji <= 'Z') {
				System.out.print( (char)((int)moji - sa) );
			} else {
				System.out.print(moji);
			}
		}
		System.out.println();
	} main {

		Scanner sc = new Scanner(System.in);

		String input = sc.nextLine();
		sc.close();

		int sa = (int)'A' - (int)'a';

		for(char moji : input.toCharArray()) {
			if('a' <= moji && moji <= 'z') {
				System.out.print( (char)((int)moji + sa) );
			} else if('A' <= moji && moji <= 'Z') {
				System.out.print( (char)((int)moji - sa) );
			} else {
				System.out.print(moji);
			}
		}
		System.out.println();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input = sc.nextLine(); input sc.nextLine() sc.nextLine sc sc.close() sc.close sc int sa = (int)'A' - (int)'a'; sa (int)'A' - (int)'a' (int)'A' (int)'a' for(char moji : input.toCharArray()) {
			if('a' <= moji && moji <= 'z') {
				System.out.print( (char)((int)moji + sa) );
			} else if('A' <= moji && moji <= 'Z') {
				System.out.print( (char)((int)moji - sa) );
			} else {
				System.out.print(moji);
			}
		} char moji input.toCharArray() input.toCharArray input {
			if('a' <= moji && moji <= 'z') {
				System.out.print( (char)((int)moji + sa) );
			} else if('A' <= moji && moji <= 'Z') {
				System.out.print( (char)((int)moji - sa) );
			} else {
				System.out.print(moji);
			}
		} {
			if('a' <= moji && moji <= 'z') {
				System.out.print( (char)((int)moji + sa) );
			} else if('A' <= moji && moji <= 'Z') {
				System.out.print( (char)((int)moji - sa) );
			} else {
				System.out.print(moji);
			}
		} if('a' <= moji && moji <= 'z') {
				System.out.print( (char)((int)moji + sa) );
			} else if('A' <= moji && moji <= 'Z') {
				System.out.print( (char)((int)moji - sa) );
			} else {
				System.out.print(moji);
			} 'a' <= moji && moji <= 'z' 'a' <= moji 'a' moji moji <= 'z' moji 'z' {
				System.out.print( (char)((int)moji + sa) );
			} System.out.print( (char)((int)moji + sa) ) System.out.print System.out System System.out (char)((int)moji + sa) (int)moji sa if('A' <= moji && moji <= 'Z') {
				System.out.print( (char)((int)moji - sa) );
			} else {
				System.out.print(moji);
			} 'A' <= moji && moji <= 'Z' 'A' <= moji 'A' moji moji <= 'Z' moji 'Z' {
				System.out.print( (char)((int)moji - sa) );
			} System.out.print( (char)((int)moji - sa) ) System.out.print System.out System System.out (char)((int)moji - sa) (int)moji sa {
				System.out.print(moji);
			} System.out.print(moji) System.out.print System.out System System.out moji System.out.println() System.out.println System.out System System.out String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String input = sc.nextLine();
		sc.close();

		int sa = (int)'A' - (int)'a';

		for(char moji : input.toCharArray()) {
			if('a' <= moji && moji <= 'z') {
				System.out.print( (char)((int)moji + sa) );
			} else if('A' <= moji && moji <= 'Z') {
				System.out.print( (char)((int)moji - sa) );
			} else {
				System.out.print(moji);
			}
		}
		System.out.println();
	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String input = sc.nextLine();
		sc.close();

		int sa = (int)'A' - (int)'a';

		for(char moji : input.toCharArray()) {
			if('a' <= moji && moji <= 'z') {
				System.out.print( (char)((int)moji + sa) );
			} else if('A' <= moji && moji <= 'Z') {
				System.out.print( (char)((int)moji - sa) );
			} else {
				System.out.print(moji);
			}
		}
		System.out.println();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String input = sc.nextLine();
		sc.close();

		int sa = (int)'A' - (int)'a';

		for(char moji : input.toCharArray()) {
			if('a' <= moji && moji <= 'z') {
				System.out.print( (char)((int)moji + sa) );
			} else if('A' <= moji && moji <= 'Z') {
				System.out.print( (char)((int)moji - sa) );
			} else {
				System.out.print(moji);
			}
		}
		System.out.println();
	}
}