import java.io.*;

public class Main {
    public static void main(String[] args) throws java.io.IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String M = in.readLine();
		String k[] = new String[M.length()];
		for(int a = 0;a<M.length();a++){
			k[a] = M.substring(a,a+1);
			if(k[a].matches( "[a-z]+" )){
				k[a] = k[a].toUpperCase();
			}else{
				k[a] = k[a].toLowerCase();
			}
			System.out.print(k[a]);
		}
		System.out.println("");
	}
} import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws java.io.IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String M = in.readLine();
		String k[] = new String[M.length()];
		for(int a = 0;a<M.length();a++){
			k[a] = M.substring(a,a+1);
			if(k[a].matches( "[a-z]+" )){
				k[a] = k[a].toUpperCase();
			}else{
				k[a] = k[a].toLowerCase();
			}
			System.out.print(k[a]);
		}
		System.out.println("");
	}
} Main public static void main(String[] args) throws java.io.IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String M = in.readLine();
		String k[] = new String[M.length()];
		for(int a = 0;a<M.length();a++){
			k[a] = M.substring(a,a+1);
			if(k[a].matches( "[a-z]+" )){
				k[a] = k[a].toUpperCase();
			}else{
				k[a] = k[a].toLowerCase();
			}
			System.out.print(k[a]);
		}
		System.out.println("");
	} main {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String M = in.readLine();
		String k[] = new String[M.length()];
		for(int a = 0;a<M.length();a++){
			k[a] = M.substring(a,a+1);
			if(k[a].matches( "[a-z]+" )){
				k[a] = k[a].toUpperCase();
			}else{
				k[a] = k[a].toLowerCase();
			}
			System.out.print(k[a]);
		}
		System.out.println("");
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String M = in.readLine(); M in.readLine() in.readLine in String k[] = new String[M.length()]; k new String[M.length()] M.length() M.length M for(int a = 0;a<M.length();a++){
			k[a] = M.substring(a,a+1);
			if(k[a].matches( "[a-z]+" )){
				k[a] = k[a].toUpperCase();
			}else{
				k[a] = k[a].toLowerCase();
			}
			System.out.print(k[a]);
		} int a = 0; int a = 0; a 0 a<M.length() a M.length() M.length M a++ a++ a {
			k[a] = M.substring(a,a+1);
			if(k[a].matches( "[a-z]+" )){
				k[a] = k[a].toUpperCase();
			}else{
				k[a] = k[a].toLowerCase();
			}
			System.out.print(k[a]);
		} {
			k[a] = M.substring(a,a+1);
			if(k[a].matches( "[a-z]+" )){
				k[a] = k[a].toUpperCase();
			}else{
				k[a] = k[a].toLowerCase();
			}
			System.out.print(k[a]);
		} k[a] = M.substring(a,a+1) k[a] k a M.substring(a,a+1) M.substring M a a+1 a 1 if(k[a].matches( "[a-z]+" )){
				k[a] = k[a].toUpperCase();
			}else{
				k[a] = k[a].toLowerCase();
			} k[a].matches( "[a-z]+" ) k[a].matches k[a] k a "[a-z]+" {
				k[a] = k[a].toUpperCase();
			} k[a] = k[a].toUpperCase() k[a] k a k[a].toUpperCase() k[a].toUpperCase k[a] k a {
				k[a] = k[a].toLowerCase();
			} k[a] = k[a].toLowerCase() k[a] k a k[a].toLowerCase() k[a].toLowerCase k[a] k a System.out.print(k[a]) System.out.print System.out System System.out k[a] k a System.out.println("") System.out.println System.out System System.out "" String[] args args public class Main {
    public static void main(String[] args) throws java.io.IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String M = in.readLine();
		String k[] = new String[M.length()];
		for(int a = 0;a<M.length();a++){
			k[a] = M.substring(a,a+1);
			if(k[a].matches( "[a-z]+" )){
				k[a] = k[a].toUpperCase();
			}else{
				k[a] = k[a].toLowerCase();
			}
			System.out.print(k[a]);
		}
		System.out.println("");
	}
} public class Main {
    public static void main(String[] args) throws java.io.IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String M = in.readLine();
		String k[] = new String[M.length()];
		for(int a = 0;a<M.length();a++){
			k[a] = M.substring(a,a+1);
			if(k[a].matches( "[a-z]+" )){
				k[a] = k[a].toUpperCase();
			}else{
				k[a] = k[a].toLowerCase();
			}
			System.out.print(k[a]);
		}
		System.out.println("");
	}
} Main
import java.io.*;

public class Main {
    public static void main(String[] args) throws java.io.IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String M = in.readLine();
		String k[] = new String[M.length()];
		for(int a = 0;a<M.length();a++){
			k[a] = M.substring(a,a+1);
			if(k[a].matches( "[a-z]+" )){
				k[a] = k[a].toUpperCase();
			}else{
				k[a] = k[a].toLowerCase();
			}
			System.out.print(k[a]);
		}
		System.out.println("");
	}
}