import java.util.*;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		StringBuilder sb = new StringBuilder();
		String s = null;
		String t = null;
		for(int i = 0; i < str.length(); i++){
			if(Character.isUpperCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toLowerCase();
			} else if(Character.isLowerCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toUpperCase();
			} else{
				s = String.valueOf(str.charAt(i));
			}
			sb.append(s);
		}
		t = sb.toString();
		System.out.println(t);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		StringBuilder sb = new StringBuilder();
		String s = null;
		String t = null;
		for(int i = 0; i < str.length(); i++){
			if(Character.isUpperCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toLowerCase();
			} else if(Character.isLowerCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toUpperCase();
			} else{
				s = String.valueOf(str.charAt(i));
			}
			sb.append(s);
		}
		t = sb.toString();
		System.out.println(t);
	}
} Main public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		StringBuilder sb = new StringBuilder();
		String s = null;
		String t = null;
		for(int i = 0; i < str.length(); i++){
			if(Character.isUpperCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toLowerCase();
			} else if(Character.isLowerCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toUpperCase();
			} else{
				s = String.valueOf(str.charAt(i));
			}
			sb.append(s);
		}
		t = sb.toString();
		System.out.println(t);
	} main {

		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		StringBuilder sb = new StringBuilder();
		String s = null;
		String t = null;
		for(int i = 0; i < str.length(); i++){
			if(Character.isUpperCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toLowerCase();
			} else if(Character.isLowerCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toUpperCase();
			} else{
				s = String.valueOf(str.charAt(i));
			}
			sb.append(s);
		}
		t = sb.toString();
		System.out.println(t);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String str = scan.nextLine(); str scan.nextLine() scan.nextLine scan StringBuilder sb = new StringBuilder(); sb new StringBuilder() String s = null; s null String t = null; t null for(int i = 0; i < str.length(); i++){
			if(Character.isUpperCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toLowerCase();
			} else if(Character.isLowerCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toUpperCase();
			} else{
				s = String.valueOf(str.charAt(i));
			}
			sb.append(s);
		} int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
			if(Character.isUpperCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toLowerCase();
			} else if(Character.isLowerCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toUpperCase();
			} else{
				s = String.valueOf(str.charAt(i));
			}
			sb.append(s);
		} {
			if(Character.isUpperCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toLowerCase();
			} else if(Character.isLowerCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toUpperCase();
			} else{
				s = String.valueOf(str.charAt(i));
			}
			sb.append(s);
		} if(Character.isUpperCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toLowerCase();
			} else if(Character.isLowerCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toUpperCase();
			} else{
				s = String.valueOf(str.charAt(i));
			} Character.isUpperCase(str.charAt(i)) Character.isUpperCase Character str.charAt(i) str.charAt str i {
				s = String.valueOf(str.charAt(i)).toLowerCase();
			} s = String.valueOf(str.charAt(i)).toLowerCase() s String.valueOf(str.charAt(i)).toLowerCase() String.valueOf(str.charAt(i)).toLowerCase String.valueOf(str.charAt(i)) String.valueOf String str.charAt(i) str.charAt str i if(Character.isLowerCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toUpperCase();
			} else{
				s = String.valueOf(str.charAt(i));
			} Character.isLowerCase(str.charAt(i)) Character.isLowerCase Character str.charAt(i) str.charAt str i {
				s = String.valueOf(str.charAt(i)).toUpperCase();
			} s = String.valueOf(str.charAt(i)).toUpperCase() s String.valueOf(str.charAt(i)).toUpperCase() String.valueOf(str.charAt(i)).toUpperCase String.valueOf(str.charAt(i)) String.valueOf String str.charAt(i) str.charAt str i {
				s = String.valueOf(str.charAt(i));
			} s = String.valueOf(str.charAt(i)) s String.valueOf(str.charAt(i)) String.valueOf String str.charAt(i) str.charAt str i sb.append(s) sb.append sb s t = sb.toString() t sb.toString() sb.toString sb System.out.println(t) System.out.println System.out System System.out t String[] args args public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		StringBuilder sb = new StringBuilder();
		String s = null;
		String t = null;
		for(int i = 0; i < str.length(); i++){
			if(Character.isUpperCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toLowerCase();
			} else if(Character.isLowerCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toUpperCase();
			} else{
				s = String.valueOf(str.charAt(i));
			}
			sb.append(s);
		}
		t = sb.toString();
		System.out.println(t);
	}
} public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		StringBuilder sb = new StringBuilder();
		String s = null;
		String t = null;
		for(int i = 0; i < str.length(); i++){
			if(Character.isUpperCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toLowerCase();
			} else if(Character.isLowerCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toUpperCase();
			} else{
				s = String.valueOf(str.charAt(i));
			}
			sb.append(s);
		}
		t = sb.toString();
		System.out.println(t);
	}
} Main
import java.util.*;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		StringBuilder sb = new StringBuilder();
		String s = null;
		String t = null;
		for(int i = 0; i < str.length(); i++){
			if(Character.isUpperCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toLowerCase();
			} else if(Character.isLowerCase(str.charAt(i))){
				s = String.valueOf(str.charAt(i)).toUpperCase();
			} else{
				s = String.valueOf(str.charAt(i));
			}
			sb.append(s);
		}
		t = sb.toString();
		System.out.println(t);
	}
}