import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.regex.Pattern;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder builder = new StringBuilder();
		Pattern upperStr = Pattern.compile("[A-Z]");
		Pattern lowerStr = Pattern.compile("[a-z]");

		String str = br.readLine();
		for(int i=0; i<str.length();i++){
			String checkStr = str.substring(i, i+1);
			if(upperStr.matcher(checkStr).find()){
				builder.append(checkStr.toLowerCase());
			}else if(lowerStr.matcher(checkStr).find()){
				builder.append(checkStr.toUpperCase());
			}else{
				builder.append(checkStr);
			}
		}

		System.out.println(builder);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.regex.Pattern; Pattern java.util.regex public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder builder = new StringBuilder();
		Pattern upperStr = Pattern.compile("[A-Z]");
		Pattern lowerStr = Pattern.compile("[a-z]");

		String str = br.readLine();
		for(int i=0; i<str.length();i++){
			String checkStr = str.substring(i, i+1);
			if(upperStr.matcher(checkStr).find()){
				builder.append(checkStr.toLowerCase());
			}else if(lowerStr.matcher(checkStr).find()){
				builder.append(checkStr.toUpperCase());
			}else{
				builder.append(checkStr);
			}
		}

		System.out.println(builder);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder builder = new StringBuilder();
		Pattern upperStr = Pattern.compile("[A-Z]");
		Pattern lowerStr = Pattern.compile("[a-z]");

		String str = br.readLine();
		for(int i=0; i<str.length();i++){
			String checkStr = str.substring(i, i+1);
			if(upperStr.matcher(checkStr).find()){
				builder.append(checkStr.toLowerCase());
			}else if(lowerStr.matcher(checkStr).find()){
				builder.append(checkStr.toUpperCase());
			}else{
				builder.append(checkStr);
			}
		}

		System.out.println(builder);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder builder = new StringBuilder();
		Pattern upperStr = Pattern.compile("[A-Z]");
		Pattern lowerStr = Pattern.compile("[a-z]");

		String str = br.readLine();
		for(int i=0; i<str.length();i++){
			String checkStr = str.substring(i, i+1);
			if(upperStr.matcher(checkStr).find()){
				builder.append(checkStr.toLowerCase());
			}else if(lowerStr.matcher(checkStr).find()){
				builder.append(checkStr.toUpperCase());
			}else{
				builder.append(checkStr);
			}
		}

		System.out.println(builder);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder builder = new StringBuilder(); builder new StringBuilder() Pattern upperStr = Pattern.compile("[A-Z]"); upperStr Pattern.compile("[A-Z]") Pattern.compile Pattern "[A-Z]" Pattern lowerStr = Pattern.compile("[a-z]"); lowerStr Pattern.compile("[a-z]") Pattern.compile Pattern "[a-z]" String str = br.readLine(); str br.readLine() br.readLine br for(int i=0; i<str.length();i++){
			String checkStr = str.substring(i, i+1);
			if(upperStr.matcher(checkStr).find()){
				builder.append(checkStr.toLowerCase());
			}else if(lowerStr.matcher(checkStr).find()){
				builder.append(checkStr.toUpperCase());
			}else{
				builder.append(checkStr);
			}
		} int i=0; int i=0; i 0 i<str.length() i str.length() str.length str i++ i++ i {
			String checkStr = str.substring(i, i+1);
			if(upperStr.matcher(checkStr).find()){
				builder.append(checkStr.toLowerCase());
			}else if(lowerStr.matcher(checkStr).find()){
				builder.append(checkStr.toUpperCase());
			}else{
				builder.append(checkStr);
			}
		} {
			String checkStr = str.substring(i, i+1);
			if(upperStr.matcher(checkStr).find()){
				builder.append(checkStr.toLowerCase());
			}else if(lowerStr.matcher(checkStr).find()){
				builder.append(checkStr.toUpperCase());
			}else{
				builder.append(checkStr);
			}
		} String checkStr = str.substring(i, i+1); checkStr str.substring(i, i+1) str.substring str i i+1 i 1 if(upperStr.matcher(checkStr).find()){
				builder.append(checkStr.toLowerCase());
			}else if(lowerStr.matcher(checkStr).find()){
				builder.append(checkStr.toUpperCase());
			}else{
				builder.append(checkStr);
			} upperStr.matcher(checkStr).find() upperStr.matcher(checkStr).find upperStr.matcher(checkStr) upperStr.matcher upperStr checkStr {
				builder.append(checkStr.toLowerCase());
			} builder.append(checkStr.toLowerCase()) builder.append builder checkStr.toLowerCase() checkStr.toLowerCase checkStr if(lowerStr.matcher(checkStr).find()){
				builder.append(checkStr.toUpperCase());
			}else{
				builder.append(checkStr);
			} lowerStr.matcher(checkStr).find() lowerStr.matcher(checkStr).find lowerStr.matcher(checkStr) lowerStr.matcher lowerStr checkStr {
				builder.append(checkStr.toUpperCase());
			} builder.append(checkStr.toUpperCase()) builder.append builder checkStr.toUpperCase() checkStr.toUpperCase checkStr {
				builder.append(checkStr);
			} builder.append(checkStr) builder.append builder checkStr System.out.println(builder) System.out.println System.out System System.out builder String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder builder = new StringBuilder();
		Pattern upperStr = Pattern.compile("[A-Z]");
		Pattern lowerStr = Pattern.compile("[a-z]");

		String str = br.readLine();
		for(int i=0; i<str.length();i++){
			String checkStr = str.substring(i, i+1);
			if(upperStr.matcher(checkStr).find()){
				builder.append(checkStr.toLowerCase());
			}else if(lowerStr.matcher(checkStr).find()){
				builder.append(checkStr.toUpperCase());
			}else{
				builder.append(checkStr);
			}
		}

		System.out.println(builder);
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder builder = new StringBuilder();
		Pattern upperStr = Pattern.compile("[A-Z]");
		Pattern lowerStr = Pattern.compile("[a-z]");

		String str = br.readLine();
		for(int i=0; i<str.length();i++){
			String checkStr = str.substring(i, i+1);
			if(upperStr.matcher(checkStr).find()){
				builder.append(checkStr.toLowerCase());
			}else if(lowerStr.matcher(checkStr).find()){
				builder.append(checkStr.toUpperCase());
			}else{
				builder.append(checkStr);
			}
		}

		System.out.println(builder);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.regex.Pattern;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder builder = new StringBuilder();
		Pattern upperStr = Pattern.compile("[A-Z]");
		Pattern lowerStr = Pattern.compile("[a-z]");

		String str = br.readLine();
		for(int i=0; i<str.length();i++){
			String checkStr = str.substring(i, i+1);
			if(upperStr.matcher(checkStr).find()){
				builder.append(checkStr.toLowerCase());
			}else if(lowerStr.matcher(checkStr).find()){
				builder.append(checkStr.toUpperCase());
			}else{
				builder.append(checkStr);
			}
		}

		System.out.println(builder);
	}
}