import java.util.*;

public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		//sc.useDelimiter("\n");

		String strBefore = new String(sc.nextLine());
		//String strBefore = new String("fAIR, LATER, OCCASIONALLY CLOUDY.");
		
		ArrayList<String> charBefore = new ArrayList<>();
		ArrayList<String> charAfter = new ArrayList<>();
		
		for(int i = 0; i < strBefore.length(); i++) {
			charBefore.add(strBefore.substring(i, i + 1));
			charAfter.add(charBefore.get(i).toUpperCase());
			if(charBefore.get(i).equals(charAfter.get(i))) {
				charAfter.set(i, charBefore.get(i).toLowerCase());
			}
			System.out.print(charAfter.get(i));
		}
		System.out.println();
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		//sc.useDelimiter("\n");

		String strBefore = new String(sc.nextLine());
		//String strBefore = new String("fAIR, LATER, OCCASIONALLY CLOUDY.");
		
		ArrayList<String> charBefore = new ArrayList<>();
		ArrayList<String> charAfter = new ArrayList<>();
		
		for(int i = 0; i < strBefore.length(); i++) {
			charBefore.add(strBefore.substring(i, i + 1));
			charAfter.add(charBefore.get(i).toUpperCase());
			if(charBefore.get(i).equals(charAfter.get(i))) {
				charAfter.set(i, charBefore.get(i).toLowerCase());
			}
			System.out.print(charAfter.get(i));
		}
		System.out.println();
	}
} Main public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		//sc.useDelimiter("\n");

		String strBefore = new String(sc.nextLine());
		//String strBefore = new String("fAIR, LATER, OCCASIONALLY CLOUDY.");
		
		ArrayList<String> charBefore = new ArrayList<>();
		ArrayList<String> charAfter = new ArrayList<>();
		
		for(int i = 0; i < strBefore.length(); i++) {
			charBefore.add(strBefore.substring(i, i + 1));
			charAfter.add(charBefore.get(i).toUpperCase());
			if(charBefore.get(i).equals(charAfter.get(i))) {
				charAfter.set(i, charBefore.get(i).toLowerCase());
			}
			System.out.print(charAfter.get(i));
		}
		System.out.println();
	} main {
		
		Scanner sc = new Scanner(System.in);
		//sc.useDelimiter("\n");

		String strBefore = new String(sc.nextLine());
		//String strBefore = new String("fAIR, LATER, OCCASIONALLY CLOUDY.");
		
		ArrayList<String> charBefore = new ArrayList<>();
		ArrayList<String> charAfter = new ArrayList<>();
		
		for(int i = 0; i < strBefore.length(); i++) {
			charBefore.add(strBefore.substring(i, i + 1));
			charAfter.add(charBefore.get(i).toUpperCase());
			if(charBefore.get(i).equals(charAfter.get(i))) {
				charAfter.set(i, charBefore.get(i).toLowerCase());
			}
			System.out.print(charAfter.get(i));
		}
		System.out.println();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String strBefore = new String(sc.nextLine()); strBefore new String(sc.nextLine()) ArrayList<String> charBefore = new ArrayList<>(); charBefore new ArrayList<>() ArrayList<String> charAfter = new ArrayList<>(); charAfter new ArrayList<>() for(int i = 0; i < strBefore.length(); i++) {
			charBefore.add(strBefore.substring(i, i + 1));
			charAfter.add(charBefore.get(i).toUpperCase());
			if(charBefore.get(i).equals(charAfter.get(i))) {
				charAfter.set(i, charBefore.get(i).toLowerCase());
			}
			System.out.print(charAfter.get(i));
		} int i = 0; int i = 0; i 0 i < strBefore.length() i strBefore.length() strBefore.length strBefore i++ i++ i {
			charBefore.add(strBefore.substring(i, i + 1));
			charAfter.add(charBefore.get(i).toUpperCase());
			if(charBefore.get(i).equals(charAfter.get(i))) {
				charAfter.set(i, charBefore.get(i).toLowerCase());
			}
			System.out.print(charAfter.get(i));
		} {
			charBefore.add(strBefore.substring(i, i + 1));
			charAfter.add(charBefore.get(i).toUpperCase());
			if(charBefore.get(i).equals(charAfter.get(i))) {
				charAfter.set(i, charBefore.get(i).toLowerCase());
			}
			System.out.print(charAfter.get(i));
		} charBefore.add(strBefore.substring(i, i + 1)) charBefore.add charBefore strBefore.substring(i, i + 1) strBefore.substring strBefore i i + 1 i 1 charAfter.add(charBefore.get(i).toUpperCase()) charAfter.add charAfter charBefore.get(i).toUpperCase() charBefore.get(i).toUpperCase charBefore.get(i) charBefore.get charBefore i if(charBefore.get(i).equals(charAfter.get(i))) {
				charAfter.set(i, charBefore.get(i).toLowerCase());
			} charBefore.get(i).equals(charAfter.get(i)) charBefore.get(i).equals charBefore.get(i) charBefore.get charBefore i charAfter.get(i) charAfter.get charAfter i {
				charAfter.set(i, charBefore.get(i).toLowerCase());
			} charAfter.set(i, charBefore.get(i).toLowerCase()) charAfter.set charAfter i charBefore.get(i).toLowerCase() charBefore.get(i).toLowerCase charBefore.get(i) charBefore.get charBefore i System.out.print(charAfter.get(i)) System.out.print System.out System System.out charAfter.get(i) charAfter.get charAfter i System.out.println() System.out.println System.out System System.out String[] args args public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		//sc.useDelimiter("\n");

		String strBefore = new String(sc.nextLine());
		//String strBefore = new String("fAIR, LATER, OCCASIONALLY CLOUDY.");
		
		ArrayList<String> charBefore = new ArrayList<>();
		ArrayList<String> charAfter = new ArrayList<>();
		
		for(int i = 0; i < strBefore.length(); i++) {
			charBefore.add(strBefore.substring(i, i + 1));
			charAfter.add(charBefore.get(i).toUpperCase());
			if(charBefore.get(i).equals(charAfter.get(i))) {
				charAfter.set(i, charBefore.get(i).toLowerCase());
			}
			System.out.print(charAfter.get(i));
		}
		System.out.println();
	}
} public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		//sc.useDelimiter("\n");

		String strBefore = new String(sc.nextLine());
		//String strBefore = new String("fAIR, LATER, OCCASIONALLY CLOUDY.");
		
		ArrayList<String> charBefore = new ArrayList<>();
		ArrayList<String> charAfter = new ArrayList<>();
		
		for(int i = 0; i < strBefore.length(); i++) {
			charBefore.add(strBefore.substring(i, i + 1));
			charAfter.add(charBefore.get(i).toUpperCase());
			if(charBefore.get(i).equals(charAfter.get(i))) {
				charAfter.set(i, charBefore.get(i).toLowerCase());
			}
			System.out.print(charAfter.get(i));
		}
		System.out.println();
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		//sc.useDelimiter("\n");

		String strBefore = new String(sc.nextLine());
		//String strBefore = new String("fAIR, LATER, OCCASIONALLY CLOUDY.");
		
		ArrayList<String> charBefore = new ArrayList<>();
		ArrayList<String> charAfter = new ArrayList<>();
		
		for(int i = 0; i < strBefore.length(); i++) {
			charBefore.add(strBefore.substring(i, i + 1));
			charAfter.add(charBefore.get(i).toUpperCase());
			if(charBefore.get(i).equals(charAfter.get(i))) {
				charAfter.set(i, charBefore.get(i).toLowerCase());
			}
			System.out.print(charAfter.get(i));
		}
		System.out.println();
	}
}