import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		char c;
		String ch, charc;
		Pattern p = Pattern.compile("[a-zA-Z]");
		Matcher m;
		
		
		ch = scan.nextLine();
		
		StringBuilder sb = new StringBuilder(ch);
		
		for( int i = 0; i < ch.length(); i++) {
			c = ch.charAt(i);
			charc = String.valueOf(c);
			m = p.matcher(charc);
			
			if(m.find()) {
				if(Character.isUpperCase(c)) {
					charc = charc.toLowerCase();
				}else {
					charc = charc.toUpperCase();
				}
				
				char cc [] = charc.toCharArray();
				sb.setCharAt(i, cc[0]);
			}
		}
		
		System.out.println(sb);
	}
} import java.util.Scanner; Scanner java.util import java.util.regex.Matcher; Matcher java.util.regex import java.util.regex.Pattern; Pattern java.util.regex public class Main {
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		char c;
		String ch, charc;
		Pattern p = Pattern.compile("[a-zA-Z]");
		Matcher m;
		
		
		ch = scan.nextLine();
		
		StringBuilder sb = new StringBuilder(ch);
		
		for( int i = 0; i < ch.length(); i++) {
			c = ch.charAt(i);
			charc = String.valueOf(c);
			m = p.matcher(charc);
			
			if(m.find()) {
				if(Character.isUpperCase(c)) {
					charc = charc.toLowerCase();
				}else {
					charc = charc.toUpperCase();
				}
				
				char cc [] = charc.toCharArray();
				sb.setCharAt(i, cc[0]);
			}
		}
		
		System.out.println(sb);
	}
} Main public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		char c;
		String ch, charc;
		Pattern p = Pattern.compile("[a-zA-Z]");
		Matcher m;
		
		
		ch = scan.nextLine();
		
		StringBuilder sb = new StringBuilder(ch);
		
		for( int i = 0; i < ch.length(); i++) {
			c = ch.charAt(i);
			charc = String.valueOf(c);
			m = p.matcher(charc);
			
			if(m.find()) {
				if(Character.isUpperCase(c)) {
					charc = charc.toLowerCase();
				}else {
					charc = charc.toUpperCase();
				}
				
				char cc [] = charc.toCharArray();
				sb.setCharAt(i, cc[0]);
			}
		}
		
		System.out.println(sb);
	} main {
		Scanner scan = new Scanner(System.in);
		char c;
		String ch, charc;
		Pattern p = Pattern.compile("[a-zA-Z]");
		Matcher m;
		
		
		ch = scan.nextLine();
		
		StringBuilder sb = new StringBuilder(ch);
		
		for( int i = 0; i < ch.length(); i++) {
			c = ch.charAt(i);
			charc = String.valueOf(c);
			m = p.matcher(charc);
			
			if(m.find()) {
				if(Character.isUpperCase(c)) {
					charc = charc.toLowerCase();
				}else {
					charc = charc.toUpperCase();
				}
				
				char cc [] = charc.toCharArray();
				sb.setCharAt(i, cc[0]);
			}
		}
		
		System.out.println(sb);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) char c; c String ch ch charc; charc Pattern p = Pattern.compile("[a-zA-Z]"); p Pattern.compile("[a-zA-Z]") Pattern.compile Pattern "[a-zA-Z]" Matcher m; m ch = scan.nextLine() ch scan.nextLine() scan.nextLine scan StringBuilder sb = new StringBuilder(ch); sb new StringBuilder(ch) for( int i = 0; i < ch.length(); i++) {
			c = ch.charAt(i);
			charc = String.valueOf(c);
			m = p.matcher(charc);
			
			if(m.find()) {
				if(Character.isUpperCase(c)) {
					charc = charc.toLowerCase();
				}else {
					charc = charc.toUpperCase();
				}
				
				char cc [] = charc.toCharArray();
				sb.setCharAt(i, cc[0]);
			}
		} int i = 0; int i = 0; i 0 i < ch.length() i ch.length() ch.length ch i++ i++ i {
			c = ch.charAt(i);
			charc = String.valueOf(c);
			m = p.matcher(charc);
			
			if(m.find()) {
				if(Character.isUpperCase(c)) {
					charc = charc.toLowerCase();
				}else {
					charc = charc.toUpperCase();
				}
				
				char cc [] = charc.toCharArray();
				sb.setCharAt(i, cc[0]);
			}
		} {
			c = ch.charAt(i);
			charc = String.valueOf(c);
			m = p.matcher(charc);
			
			if(m.find()) {
				if(Character.isUpperCase(c)) {
					charc = charc.toLowerCase();
				}else {
					charc = charc.toUpperCase();
				}
				
				char cc [] = charc.toCharArray();
				sb.setCharAt(i, cc[0]);
			}
		} c = ch.charAt(i) c ch.charAt(i) ch.charAt ch i charc = String.valueOf(c) charc String.valueOf(c) String.valueOf String c m = p.matcher(charc) m p.matcher(charc) p.matcher p charc if(m.find()) {
				if(Character.isUpperCase(c)) {
					charc = charc.toLowerCase();
				}else {
					charc = charc.toUpperCase();
				}
				
				char cc [] = charc.toCharArray();
				sb.setCharAt(i, cc[0]);
			} m.find() m.find m {
				if(Character.isUpperCase(c)) {
					charc = charc.toLowerCase();
				}else {
					charc = charc.toUpperCase();
				}
				
				char cc [] = charc.toCharArray();
				sb.setCharAt(i, cc[0]);
			} if(Character.isUpperCase(c)) {
					charc = charc.toLowerCase();
				}else {
					charc = charc.toUpperCase();
				} Character.isUpperCase(c) Character.isUpperCase Character c {
					charc = charc.toLowerCase();
				} charc = charc.toLowerCase() charc charc.toLowerCase() charc.toLowerCase charc {
					charc = charc.toUpperCase();
				} charc = charc.toUpperCase() charc charc.toUpperCase() charc.toUpperCase charc char cc [] = charc.toCharArray(); cc charc.toCharArray() charc.toCharArray charc sb.setCharAt(i, cc[0]) sb.setCharAt sb i cc[0] cc 0 System.out.println(sb) System.out.println System.out System System.out sb String [] args args public class Main {
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		char c;
		String ch, charc;
		Pattern p = Pattern.compile("[a-zA-Z]");
		Matcher m;
		
		
		ch = scan.nextLine();
		
		StringBuilder sb = new StringBuilder(ch);
		
		for( int i = 0; i < ch.length(); i++) {
			c = ch.charAt(i);
			charc = String.valueOf(c);
			m = p.matcher(charc);
			
			if(m.find()) {
				if(Character.isUpperCase(c)) {
					charc = charc.toLowerCase();
				}else {
					charc = charc.toUpperCase();
				}
				
				char cc [] = charc.toCharArray();
				sb.setCharAt(i, cc[0]);
			}
		}
		
		System.out.println(sb);
	}
} public class Main {
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		char c;
		String ch, charc;
		Pattern p = Pattern.compile("[a-zA-Z]");
		Matcher m;
		
		
		ch = scan.nextLine();
		
		StringBuilder sb = new StringBuilder(ch);
		
		for( int i = 0; i < ch.length(); i++) {
			c = ch.charAt(i);
			charc = String.valueOf(c);
			m = p.matcher(charc);
			
			if(m.find()) {
				if(Character.isUpperCase(c)) {
					charc = charc.toLowerCase();
				}else {
					charc = charc.toUpperCase();
				}
				
				char cc [] = charc.toCharArray();
				sb.setCharAt(i, cc[0]);
			}
		}
		
		System.out.println(sb);
	}
} Main
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		char c;
		String ch, charc;
		Pattern p = Pattern.compile("[a-zA-Z]");
		Matcher m;
		
		
		ch = scan.nextLine();
		
		StringBuilder sb = new StringBuilder(ch);
		
		for( int i = 0; i < ch.length(); i++) {
			c = ch.charAt(i);
			charc = String.valueOf(c);
			m = p.matcher(charc);
			
			if(m.find()) {
				if(Character.isUpperCase(c)) {
					charc = charc.toLowerCase();
				}else {
					charc = charc.toUpperCase();
				}
				
				char cc [] = charc.toCharArray();
				sb.setCharAt(i, cc[0]);
			}
		}
		
		System.out.println(sb);
	}
}
