import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		String ins = scan.nextLine();

		for (int i = 0; i < ins.length(); i++)
			System.out.print(revCap(ins.charAt(i)));

		System.out.println();

		System.exit(0);
	}

	private static char revCap(char in) {
		if (in >= 'a' && in <= 'z')
			return (char) (in - 'a' + 'A');
		if (in >= 'A' && in <= 'Z')
			return (char) (in - 'A' + 'a');
		return in;
	}

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

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		String ins = scan.nextLine();

		for (int i = 0; i < ins.length(); i++)
			System.out.print(revCap(ins.charAt(i)));

		System.out.println();

		System.exit(0);
	}

	private static char revCap(char in) {
		if (in >= 'a' && in <= 'z')
			return (char) (in - 'a' + 'A');
		if (in >= 'A' && in <= 'Z')
			return (char) (in - 'A' + 'a');
		return in;
	}

} Main public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		String ins = scan.nextLine();

		for (int i = 0; i < ins.length(); i++)
			System.out.print(revCap(ins.charAt(i)));

		System.out.println();

		System.exit(0);
	} main {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		String ins = scan.nextLine();

		for (int i = 0; i < ins.length(); i++)
			System.out.print(revCap(ins.charAt(i)));

		System.out.println();

		System.exit(0);
	} @SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String ins = scan.nextLine(); ins scan.nextLine() scan.nextLine scan for (int i = 0; i < ins.length(); i++)
			System.out.print(revCap(ins.charAt(i))); int i = 0; int i = 0; i 0 i < ins.length() i ins.length() ins.length ins i++ i++ i System.out.print(revCap(ins.charAt(i))); System.out.print(revCap(ins.charAt(i))) System.out.print System.out System System.out revCap(ins.charAt(i)) revCap ins.charAt(i) ins.charAt ins i System.out.println() System.out.println System.out System System.out System.exit(0) System.exit System 0 String[] args args private static char revCap(char in) {
		if (in >= 'a' && in <= 'z')
			return (char) (in - 'a' + 'A');
		if (in >= 'A' && in <= 'Z')
			return (char) (in - 'A' + 'a');
		return in;
	} revCap {
		if (in >= 'a' && in <= 'z')
			return (char) (in - 'a' + 'A');
		if (in >= 'A' && in <= 'Z')
			return (char) (in - 'A' + 'a');
		return in;
	} if (in >= 'a' && in <= 'z')
			return (char) (in - 'a' + 'A'); in >= 'a' && in <= 'z' in >= 'a' in 'a' in <= 'z' in 'z' return (char) (in - 'a' + 'A'); (char) (in - 'a' + 'A') in - 'a' in 'a' 'A' if (in >= 'A' && in <= 'Z')
			return (char) (in - 'A' + 'a'); in >= 'A' && in <= 'Z' in >= 'A' in 'A' in <= 'Z' in 'Z' return (char) (in - 'A' + 'a'); (char) (in - 'A' + 'a') in - 'A' in 'A' 'a' return in; in char in in public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		String ins = scan.nextLine();

		for (int i = 0; i < ins.length(); i++)
			System.out.print(revCap(ins.charAt(i)));

		System.out.println();

		System.exit(0);
	}

	private static char revCap(char in) {
		if (in >= 'a' && in <= 'z')
			return (char) (in - 'a' + 'A');
		if (in >= 'A' && in <= 'Z')
			return (char) (in - 'A' + 'a');
		return in;
	}

} public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		String ins = scan.nextLine();

		for (int i = 0; i < ins.length(); i++)
			System.out.print(revCap(ins.charAt(i)));

		System.out.println();

		System.exit(0);
	}

	private static char revCap(char in) {
		if (in >= 'a' && in <= 'z')
			return (char) (in - 'a' + 'A');
		if (in >= 'A' && in <= 'Z')
			return (char) (in - 'A' + 'a');
		return in;
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		String ins = scan.nextLine();

		for (int i = 0; i < ins.length(); i++)
			System.out.print(revCap(ins.charAt(i)));

		System.out.println();

		System.exit(0);
	}

	private static char revCap(char in) {
		if (in >= 'a' && in <= 'z')
			return (char) (in - 'a' + 'A');
		if (in >= 'A' && in <= 'Z')
			return (char) (in - 'A' + 'a');
		return in;
	}

}