import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

class Main{

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String input = br.readLine();

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

			char token = input.charAt(i);

			if(Character.isUpperCase(token)){
				sb.append(Character.toLowerCase(token));
			}else{
				sb.append(Character.toUpperCase(token));
			}

		}

		System.out.println(sb);

	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io class Main{

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String input = br.readLine();

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

			char token = input.charAt(i);

			if(Character.isUpperCase(token)){
				sb.append(Character.toLowerCase(token));
			}else{
				sb.append(Character.toUpperCase(token));
			}

		}

		System.out.println(sb);

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String input = br.readLine();

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

			char token = input.charAt(i);

			if(Character.isUpperCase(token)){
				sb.append(Character.toLowerCase(token));
			}else{
				sb.append(Character.toUpperCase(token));
			}

		}

		System.out.println(sb);

	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String input = br.readLine();

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

			char token = input.charAt(i);

			if(Character.isUpperCase(token)){
				sb.append(Character.toLowerCase(token));
			}else{
				sb.append(Character.toUpperCase(token));
			}

		}

		System.out.println(sb);

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

			char token = input.charAt(i);

			if(Character.isUpperCase(token)){
				sb.append(Character.toLowerCase(token));
			}else{
				sb.append(Character.toUpperCase(token));
			}

		} int i = 0; int i = 0; i 0 i < input.length() i input.length() input.length input i++ i++ i {

			char token = input.charAt(i);

			if(Character.isUpperCase(token)){
				sb.append(Character.toLowerCase(token));
			}else{
				sb.append(Character.toUpperCase(token));
			}

		} {

			char token = input.charAt(i);

			if(Character.isUpperCase(token)){
				sb.append(Character.toLowerCase(token));
			}else{
				sb.append(Character.toUpperCase(token));
			}

		} char token = input.charAt(i); token input.charAt(i) input.charAt input i if(Character.isUpperCase(token)){
				sb.append(Character.toLowerCase(token));
			}else{
				sb.append(Character.toUpperCase(token));
			} Character.isUpperCase(token) Character.isUpperCase Character token {
				sb.append(Character.toLowerCase(token));
			} sb.append(Character.toLowerCase(token)) sb.append sb Character.toLowerCase(token) Character.toLowerCase Character token {
				sb.append(Character.toUpperCase(token));
			} sb.append(Character.toUpperCase(token)) sb.append sb Character.toUpperCase(token) Character.toUpperCase Character token System.out.println(sb) System.out.println System.out System System.out sb String[] args args
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

class Main{

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String input = br.readLine();

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

			char token = input.charAt(i);

			if(Character.isUpperCase(token)){
				sb.append(Character.toLowerCase(token));
			}else{
				sb.append(Character.toUpperCase(token));
			}

		}

		System.out.println(sb);

	}
}