import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String oldstr = scan.nextLine();
		scan.close();
		String newstr = "";
		//char substr[] = str.toCharArray();
		for(int i = 0; i < oldstr.length(); i++){
			String target = oldstr.substring(i, i + 1);
			if(target.equals(target.toLowerCase())){
				target = target.toUpperCase();
			}else if(target.equals(target.toUpperCase())){
				target = target.toLowerCase();
			}
			newstr += target;
		}
		System.out.println(newstr);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String oldstr = scan.nextLine();
		scan.close();
		String newstr = "";
		//char substr[] = str.toCharArray();
		for(int i = 0; i < oldstr.length(); i++){
			String target = oldstr.substring(i, i + 1);
			if(target.equals(target.toLowerCase())){
				target = target.toUpperCase();
			}else if(target.equals(target.toUpperCase())){
				target = target.toLowerCase();
			}
			newstr += target;
		}
		System.out.println(newstr);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String oldstr = scan.nextLine();
		scan.close();
		String newstr = "";
		//char substr[] = str.toCharArray();
		for(int i = 0; i < oldstr.length(); i++){
			String target = oldstr.substring(i, i + 1);
			if(target.equals(target.toLowerCase())){
				target = target.toUpperCase();
			}else if(target.equals(target.toUpperCase())){
				target = target.toLowerCase();
			}
			newstr += target;
		}
		System.out.println(newstr);
	} main {
		Scanner scan = new Scanner(System.in);
		String oldstr = scan.nextLine();
		scan.close();
		String newstr = "";
		//char substr[] = str.toCharArray();
		for(int i = 0; i < oldstr.length(); i++){
			String target = oldstr.substring(i, i + 1);
			if(target.equals(target.toLowerCase())){
				target = target.toUpperCase();
			}else if(target.equals(target.toUpperCase())){
				target = target.toLowerCase();
			}
			newstr += target;
		}
		System.out.println(newstr);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String oldstr = scan.nextLine(); oldstr scan.nextLine() scan.nextLine scan scan.close() scan.close scan String newstr = ""; newstr "" for(int i = 0; i < oldstr.length(); i++){
			String target = oldstr.substring(i, i + 1);
			if(target.equals(target.toLowerCase())){
				target = target.toUpperCase();
			}else if(target.equals(target.toUpperCase())){
				target = target.toLowerCase();
			}
			newstr += target;
		} int i = 0; int i = 0; i 0 i < oldstr.length() i oldstr.length() oldstr.length oldstr i++ i++ i {
			String target = oldstr.substring(i, i + 1);
			if(target.equals(target.toLowerCase())){
				target = target.toUpperCase();
			}else if(target.equals(target.toUpperCase())){
				target = target.toLowerCase();
			}
			newstr += target;
		} {
			String target = oldstr.substring(i, i + 1);
			if(target.equals(target.toLowerCase())){
				target = target.toUpperCase();
			}else if(target.equals(target.toUpperCase())){
				target = target.toLowerCase();
			}
			newstr += target;
		} String target = oldstr.substring(i, i + 1); target oldstr.substring(i, i + 1) oldstr.substring oldstr i i + 1 i 1 if(target.equals(target.toLowerCase())){
				target = target.toUpperCase();
			}else if(target.equals(target.toUpperCase())){
				target = target.toLowerCase();
			} target.equals(target.toLowerCase()) target.equals target target.toLowerCase() target.toLowerCase target {
				target = target.toUpperCase();
			} target = target.toUpperCase() target target.toUpperCase() target.toUpperCase target if(target.equals(target.toUpperCase())){
				target = target.toLowerCase();
			} target.equals(target.toUpperCase()) target.equals target target.toUpperCase() target.toUpperCase target {
				target = target.toLowerCase();
			} target = target.toLowerCase() target target.toLowerCase() target.toLowerCase target newstr += target newstr target System.out.println(newstr) System.out.println System.out System System.out newstr String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String oldstr = scan.nextLine();
		scan.close();
		String newstr = "";
		//char substr[] = str.toCharArray();
		for(int i = 0; i < oldstr.length(); i++){
			String target = oldstr.substring(i, i + 1);
			if(target.equals(target.toLowerCase())){
				target = target.toUpperCase();
			}else if(target.equals(target.toUpperCase())){
				target = target.toLowerCase();
			}
			newstr += target;
		}
		System.out.println(newstr);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String oldstr = scan.nextLine();
		scan.close();
		String newstr = "";
		//char substr[] = str.toCharArray();
		for(int i = 0; i < oldstr.length(); i++){
			String target = oldstr.substring(i, i + 1);
			if(target.equals(target.toLowerCase())){
				target = target.toUpperCase();
			}else if(target.equals(target.toUpperCase())){
				target = target.toLowerCase();
			}
			newstr += target;
		}
		System.out.println(newstr);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String oldstr = scan.nextLine();
		scan.close();
		String newstr = "";
		//char substr[] = str.toCharArray();
		for(int i = 0; i < oldstr.length(); i++){
			String target = oldstr.substring(i, i + 1);
			if(target.equals(target.toLowerCase())){
				target = target.toUpperCase();
			}else if(target.equals(target.toUpperCase())){
				target = target.toLowerCase();
			}
			newstr += target;
		}
		System.out.println(newstr);
	}
}