import java.util.*;

class Main {
	public static void main(String[] args){
		final Scanner sc = new Scanner(System.in);		
		final String str = sc.nextLine();
		StringBuilder sb = new StringBuilder();

		for(int i = 0; i < str.length(); i++){
			final char c = str.charAt(i);
			if('a' <= c && c <= 'z'){
				sb.append(String.valueOf(c).toUpperCase());
			} else if('A' <= c && c <= 'Z'){
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				sb.append(String.valueOf(c));
			}
			
		}
		System.out.println(sb.toString());
	}
} import java.util.*; util.* java class Main {
	public static void main(String[] args){
		final Scanner sc = new Scanner(System.in);		
		final String str = sc.nextLine();
		StringBuilder sb = new StringBuilder();

		for(int i = 0; i < str.length(); i++){
			final char c = str.charAt(i);
			if('a' <= c && c <= 'z'){
				sb.append(String.valueOf(c).toUpperCase());
			} else if('A' <= c && c <= 'Z'){
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				sb.append(String.valueOf(c));
			}
			
		}
		System.out.println(sb.toString());
	}
} Main public static void main(String[] args){
		final Scanner sc = new Scanner(System.in);		
		final String str = sc.nextLine();
		StringBuilder sb = new StringBuilder();

		for(int i = 0; i < str.length(); i++){
			final char c = str.charAt(i);
			if('a' <= c && c <= 'z'){
				sb.append(String.valueOf(c).toUpperCase());
			} else if('A' <= c && c <= 'Z'){
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				sb.append(String.valueOf(c));
			}
			
		}
		System.out.println(sb.toString());
	} main {
		final Scanner sc = new Scanner(System.in);		
		final String str = sc.nextLine();
		StringBuilder sb = new StringBuilder();

		for(int i = 0; i < str.length(); i++){
			final char c = str.charAt(i);
			if('a' <= c && c <= 'z'){
				sb.append(String.valueOf(c).toUpperCase());
			} else if('A' <= c && c <= 'Z'){
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				sb.append(String.valueOf(c));
			}
			
		}
		System.out.println(sb.toString());
	} final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i = 0; i < str.length(); i++){
			final char c = str.charAt(i);
			if('a' <= c && c <= 'z'){
				sb.append(String.valueOf(c).toUpperCase());
			} else if('A' <= c && c <= 'Z'){
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				sb.append(String.valueOf(c));
			}
			
		} int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
			final char c = str.charAt(i);
			if('a' <= c && c <= 'z'){
				sb.append(String.valueOf(c).toUpperCase());
			} else if('A' <= c && c <= 'Z'){
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				sb.append(String.valueOf(c));
			}
			
		} {
			final char c = str.charAt(i);
			if('a' <= c && c <= 'z'){
				sb.append(String.valueOf(c).toUpperCase());
			} else if('A' <= c && c <= 'Z'){
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				sb.append(String.valueOf(c));
			}
			
		} final char c = str.charAt(i); c str.charAt(i) str.charAt str i if('a' <= c && c <= 'z'){
				sb.append(String.valueOf(c).toUpperCase());
			} else if('A' <= c && c <= 'Z'){
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				sb.append(String.valueOf(c));
			} 'a' <= c && c <= 'z' 'a' <= c 'a' c c <= 'z' c 'z' {
				sb.append(String.valueOf(c).toUpperCase());
			} sb.append(String.valueOf(c).toUpperCase()) sb.append sb String.valueOf(c).toUpperCase() String.valueOf(c).toUpperCase String.valueOf(c) String.valueOf String c if('A' <= c && c <= 'Z'){
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				sb.append(String.valueOf(c));
			} 'A' <= c && c <= 'Z' 'A' <= c 'A' c c <= 'Z' c 'Z' {
				sb.append(String.valueOf(c).toLowerCase());
			} sb.append(String.valueOf(c).toLowerCase()) sb.append sb String.valueOf(c).toLowerCase() String.valueOf(c).toLowerCase String.valueOf(c) String.valueOf String c {
				sb.append(String.valueOf(c));
			} sb.append(String.valueOf(c)) sb.append sb String.valueOf(c) String.valueOf String c System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb String[] args args
import java.util.*;

class Main {
	public static void main(String[] args){
		final Scanner sc = new Scanner(System.in);		
		final String str = sc.nextLine();
		StringBuilder sb = new StringBuilder();

		for(int i = 0; i < str.length(); i++){
			final char c = str.charAt(i);
			if('a' <= c && c <= 'z'){
				sb.append(String.valueOf(c).toUpperCase());
			} else if('A' <= c && c <= 'Z'){
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				sb.append(String.valueOf(c));
			}
			
		}
		System.out.println(sb.toString());
	}
}