import java.io.*;

class Main {
	public static void main(String[] args) throws IOException {

		BufferedReader input = new BufferedReader (new InputStreamReader(System.in));
		String str = input.readLine();

		for (int i = 0; i < str.length(); i++) {

			if (Character.isLowerCase(str.charAt(i)))
				System.out.print(Character.toUpperCase(str.charAt(i)));
			else
				System.out.print(Character.toLowerCase(str.charAt(i)));
		}
		System.out.println();

	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args) throws IOException {

		BufferedReader input = new BufferedReader (new InputStreamReader(System.in));
		String str = input.readLine();

		for (int i = 0; i < str.length(); i++) {

			if (Character.isLowerCase(str.charAt(i)))
				System.out.print(Character.toUpperCase(str.charAt(i)));
			else
				System.out.print(Character.toLowerCase(str.charAt(i)));
		}
		System.out.println();

	}
} Main public static void main(String[] args) throws IOException {

		BufferedReader input = new BufferedReader (new InputStreamReader(System.in));
		String str = input.readLine();

		for (int i = 0; i < str.length(); i++) {

			if (Character.isLowerCase(str.charAt(i)))
				System.out.print(Character.toUpperCase(str.charAt(i)));
			else
				System.out.print(Character.toLowerCase(str.charAt(i)));
		}
		System.out.println();

	} main {

		BufferedReader input = new BufferedReader (new InputStreamReader(System.in));
		String str = input.readLine();

		for (int i = 0; i < str.length(); i++) {

			if (Character.isLowerCase(str.charAt(i)))
				System.out.print(Character.toUpperCase(str.charAt(i)));
			else
				System.out.print(Character.toLowerCase(str.charAt(i)));
		}
		System.out.println();

	} BufferedReader input = new BufferedReader (new InputStreamReader(System.in)); input new BufferedReader (new InputStreamReader(System.in)) String str = input.readLine(); str input.readLine() input.readLine input for (int i = 0; i < str.length(); i++) {

			if (Character.isLowerCase(str.charAt(i)))
				System.out.print(Character.toUpperCase(str.charAt(i)));
			else
				System.out.print(Character.toLowerCase(str.charAt(i)));
		} int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {

			if (Character.isLowerCase(str.charAt(i)))
				System.out.print(Character.toUpperCase(str.charAt(i)));
			else
				System.out.print(Character.toLowerCase(str.charAt(i)));
		} {

			if (Character.isLowerCase(str.charAt(i)))
				System.out.print(Character.toUpperCase(str.charAt(i)));
			else
				System.out.print(Character.toLowerCase(str.charAt(i)));
		} if (Character.isLowerCase(str.charAt(i)))
				System.out.print(Character.toUpperCase(str.charAt(i)));
			else
				System.out.print(Character.toLowerCase(str.charAt(i))); Character.isLowerCase(str.charAt(i)) Character.isLowerCase Character str.charAt(i) str.charAt str i System.out.print(Character.toUpperCase(str.charAt(i))) System.out.print System.out System System.out Character.toUpperCase(str.charAt(i)) Character.toUpperCase Character str.charAt(i) str.charAt str i System.out.print(Character.toLowerCase(str.charAt(i))) System.out.print System.out System System.out Character.toLowerCase(str.charAt(i)) Character.toLowerCase Character str.charAt(i) str.charAt str i System.out.println() System.out.println System.out System System.out String[] args args
import java.io.*;

class Main {
	public static void main(String[] args) throws IOException {

		BufferedReader input = new BufferedReader (new InputStreamReader(System.in));
		String str = input.readLine();

		for (int i = 0; i < str.length(); i++) {

			if (Character.isLowerCase(str.charAt(i)))
				System.out.print(Character.toUpperCase(str.charAt(i)));
			else
				System.out.print(Character.toLowerCase(str.charAt(i)));
		}
		System.out.println();

	}
}