import java.util.*;

public class Main{
	public static void main(String[] args) {
		String i,o;
		Scanner sc = new Scanner(System.in);
		i = sc.nextLine();
		o = "";
		sc.close();
		
		int j;
		for (j=0 ; j<i.length() ; j++) {
			char a;
			a = i.charAt(j);
			if (a>='A' && a<='Z') {
				a += 'a'-'A';
			}else if (a>='a' && a<='z') {
				a += 'A'-'a';
			}
			o = o+a;
		}
		System.out.println(o);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args) {
		String i,o;
		Scanner sc = new Scanner(System.in);
		i = sc.nextLine();
		o = "";
		sc.close();
		
		int j;
		for (j=0 ; j<i.length() ; j++) {
			char a;
			a = i.charAt(j);
			if (a>='A' && a<='Z') {
				a += 'a'-'A';
			}else if (a>='a' && a<='z') {
				a += 'A'-'a';
			}
			o = o+a;
		}
		System.out.println(o);
	}
} Main public static void main(String[] args) {
		String i,o;
		Scanner sc = new Scanner(System.in);
		i = sc.nextLine();
		o = "";
		sc.close();
		
		int j;
		for (j=0 ; j<i.length() ; j++) {
			char a;
			a = i.charAt(j);
			if (a>='A' && a<='Z') {
				a += 'a'-'A';
			}else if (a>='a' && a<='z') {
				a += 'A'-'a';
			}
			o = o+a;
		}
		System.out.println(o);
	} main {
		String i,o;
		Scanner sc = new Scanner(System.in);
		i = sc.nextLine();
		o = "";
		sc.close();
		
		int j;
		for (j=0 ; j<i.length() ; j++) {
			char a;
			a = i.charAt(j);
			if (a>='A' && a<='Z') {
				a += 'a'-'A';
			}else if (a>='a' && a<='z') {
				a += 'A'-'a';
			}
			o = o+a;
		}
		System.out.println(o);
	} String i i o; o Scanner sc = new Scanner(System.in); sc new Scanner(System.in) i = sc.nextLine() i sc.nextLine() sc.nextLine sc o = "" o "" sc.close() sc.close sc int j; j for (j=0 ; j<i.length() ; j++) {
			char a;
			a = i.charAt(j);
			if (a>='A' && a<='Z') {
				a += 'a'-'A';
			}else if (a>='a' && a<='z') {
				a += 'A'-'a';
			}
			o = o+a;
		} j=0 ; j=0 j 0 j<i.length() j i.length() i.length i j++ j++ j {
			char a;
			a = i.charAt(j);
			if (a>='A' && a<='Z') {
				a += 'a'-'A';
			}else if (a>='a' && a<='z') {
				a += 'A'-'a';
			}
			o = o+a;
		} {
			char a;
			a = i.charAt(j);
			if (a>='A' && a<='Z') {
				a += 'a'-'A';
			}else if (a>='a' && a<='z') {
				a += 'A'-'a';
			}
			o = o+a;
		} char a; a a = i.charAt(j) a i.charAt(j) i.charAt i j if (a>='A' && a<='Z') {
				a += 'a'-'A';
			}else if (a>='a' && a<='z') {
				a += 'A'-'a';
			} a>='A' && a<='Z' a>='A' a 'A' a<='Z' a 'Z' {
				a += 'a'-'A';
			} a += 'a'-'A' a 'a'-'A' 'a' 'A' if (a>='a' && a<='z') {
				a += 'A'-'a';
			} a>='a' && a<='z' a>='a' a 'a' a<='z' a 'z' {
				a += 'A'-'a';
			} a += 'A'-'a' a 'A'-'a' 'A' 'a' o = o+a o o+a o a System.out.println(o) System.out.println System.out System System.out o String[] args args public class Main{
	public static void main(String[] args) {
		String i,o;
		Scanner sc = new Scanner(System.in);
		i = sc.nextLine();
		o = "";
		sc.close();
		
		int j;
		for (j=0 ; j<i.length() ; j++) {
			char a;
			a = i.charAt(j);
			if (a>='A' && a<='Z') {
				a += 'a'-'A';
			}else if (a>='a' && a<='z') {
				a += 'A'-'a';
			}
			o = o+a;
		}
		System.out.println(o);
	}
} public class Main{
	public static void main(String[] args) {
		String i,o;
		Scanner sc = new Scanner(System.in);
		i = sc.nextLine();
		o = "";
		sc.close();
		
		int j;
		for (j=0 ; j<i.length() ; j++) {
			char a;
			a = i.charAt(j);
			if (a>='A' && a<='Z') {
				a += 'a'-'A';
			}else if (a>='a' && a<='z') {
				a += 'A'-'a';
			}
			o = o+a;
		}
		System.out.println(o);
	}
} Main
import java.util.*;

public class Main{
	public static void main(String[] args) {
		String i,o;
		Scanner sc = new Scanner(System.in);
		i = sc.nextLine();
		o = "";
		sc.close();
		
		int j;
		for (j=0 ; j<i.length() ; j++) {
			char a;
			a = i.charAt(j);
			if (a>='A' && a<='Z') {
				a += 'a'-'A';
			}else if (a>='a' && a<='z') {
				a += 'A'-'a';
			}
			o = o+a;
		}
		System.out.println(o);
	}
}
