import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] text = sc.nextLine().toCharArray();
		
		for(int i=0; i<text.length; i++) {
			if(Character.isUpperCase(text[i])) {
				text[i] = Character.toLowerCase(text[i]);
			} else {
				text[i] = Character.toUpperCase(text[i]);
			}
		}
		
		System.out.println(text);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] text = sc.nextLine().toCharArray();
		
		for(int i=0; i<text.length; i++) {
			if(Character.isUpperCase(text[i])) {
				text[i] = Character.toLowerCase(text[i]);
			} else {
				text[i] = Character.toUpperCase(text[i]);
			}
		}
		
		System.out.println(text);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] text = sc.nextLine().toCharArray();
		
		for(int i=0; i<text.length; i++) {
			if(Character.isUpperCase(text[i])) {
				text[i] = Character.toLowerCase(text[i]);
			} else {
				text[i] = Character.toUpperCase(text[i]);
			}
		}
		
		System.out.println(text);
	} main {
		Scanner sc = new Scanner(System.in);
		char[] text = sc.nextLine().toCharArray();
		
		for(int i=0; i<text.length; i++) {
			if(Character.isUpperCase(text[i])) {
				text[i] = Character.toLowerCase(text[i]);
			} else {
				text[i] = Character.toUpperCase(text[i]);
			}
		}
		
		System.out.println(text);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] text = sc.nextLine().toCharArray(); text sc.nextLine().toCharArray() sc.nextLine().toCharArray sc.nextLine() sc.nextLine sc for(int i=0; i<text.length; i++) {
			if(Character.isUpperCase(text[i])) {
				text[i] = Character.toLowerCase(text[i]);
			} else {
				text[i] = Character.toUpperCase(text[i]);
			}
		} int i=0; int i=0; i 0 i<text.length i text.length text text.length i++ i++ i {
			if(Character.isUpperCase(text[i])) {
				text[i] = Character.toLowerCase(text[i]);
			} else {
				text[i] = Character.toUpperCase(text[i]);
			}
		} {
			if(Character.isUpperCase(text[i])) {
				text[i] = Character.toLowerCase(text[i]);
			} else {
				text[i] = Character.toUpperCase(text[i]);
			}
		} if(Character.isUpperCase(text[i])) {
				text[i] = Character.toLowerCase(text[i]);
			} else {
				text[i] = Character.toUpperCase(text[i]);
			} Character.isUpperCase(text[i]) Character.isUpperCase Character text[i] text i {
				text[i] = Character.toLowerCase(text[i]);
			} text[i] = Character.toLowerCase(text[i]) text[i] text i Character.toLowerCase(text[i]) Character.toLowerCase Character text[i] text i {
				text[i] = Character.toUpperCase(text[i]);
			} text[i] = Character.toUpperCase(text[i]) text[i] text i Character.toUpperCase(text[i]) Character.toUpperCase Character text[i] text i System.out.println(text) System.out.println System.out System System.out text String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] text = sc.nextLine().toCharArray();
		
		for(int i=0; i<text.length; i++) {
			if(Character.isUpperCase(text[i])) {
				text[i] = Character.toLowerCase(text[i]);
			} else {
				text[i] = Character.toUpperCase(text[i]);
			}
		}
		
		System.out.println(text);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] text = sc.nextLine().toCharArray();
		
		for(int i=0; i<text.length; i++) {
			if(Character.isUpperCase(text[i])) {
				text[i] = Character.toLowerCase(text[i]);
			} else {
				text[i] = Character.toUpperCase(text[i]);
			}
		}
		
		System.out.println(text);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] text = sc.nextLine().toCharArray();
		
		for(int i=0; i<text.length; i++) {
			if(Character.isUpperCase(text[i])) {
				text[i] = Character.toLowerCase(text[i]);
			} else {
				text[i] = Character.toUpperCase(text[i]);
			}
		}
		
		System.out.println(text);
	}

}