

import java.util.*;
import java.io.*;

public class Main {
	public static void main(String args[])throws IOException {
		//BufferedReader??§??????????????????input??????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String str;
		str = br.readLine();
		char c;
		
		//??????????????????????????????
		for(int count=0;count<str.length();count++){
			c = str.charAt(count);
			// ??§???????????¨???true
			if (Character.isUpperCase(c)) {
				//?°????????????????
				//String???????????´???????°????????????????
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				//??§???????????????
				//String???????????´????????§???????????????
				sb.append(String.valueOf(c).toUpperCase());
			}
		}
		System.out.println(new String(sb));
	}
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
	public static void main(String args[])throws IOException {
		//BufferedReader??§??????????????????input??????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String str;
		str = br.readLine();
		char c;
		
		//??????????????????????????????
		for(int count=0;count<str.length();count++){
			c = str.charAt(count);
			// ??§???????????¨???true
			if (Character.isUpperCase(c)) {
				//?°????????????????
				//String???????????´???????°????????????????
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				//??§???????????????
				//String???????????´????????§???????????????
				sb.append(String.valueOf(c).toUpperCase());
			}
		}
		System.out.println(new String(sb));
	}
} Main public static void main(String args[])throws IOException {
		//BufferedReader??§??????????????????input??????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String str;
		str = br.readLine();
		char c;
		
		//??????????????????????????????
		for(int count=0;count<str.length();count++){
			c = str.charAt(count);
			// ??§???????????¨???true
			if (Character.isUpperCase(c)) {
				//?°????????????????
				//String???????????´???????°????????????????
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				//??§???????????????
				//String???????????´????????§???????????????
				sb.append(String.valueOf(c).toUpperCase());
			}
		}
		System.out.println(new String(sb));
	} main {
		//BufferedReader??§??????????????????input??????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String str;
		str = br.readLine();
		char c;
		
		//??????????????????????????????
		for(int count=0;count<str.length();count++){
			c = str.charAt(count);
			// ??§???????????¨???true
			if (Character.isUpperCase(c)) {
				//?°????????????????
				//String???????????´???????°????????????????
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				//??§???????????????
				//String???????????´????????§???????????????
				sb.append(String.valueOf(c).toUpperCase());
			}
		}
		System.out.println(new String(sb));
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() String str; str str = br.readLine() str br.readLine() br.readLine br char c; c for(int count=0;count<str.length();count++){
			c = str.charAt(count);
			// ??§???????????¨???true
			if (Character.isUpperCase(c)) {
				//?°????????????????
				//String???????????´???????°????????????????
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				//??§???????????????
				//String???????????´????????§???????????????
				sb.append(String.valueOf(c).toUpperCase());
			}
		} int count=0; int count=0; count 0 count<str.length() count str.length() str.length str count++ count++ count {
			c = str.charAt(count);
			// ??§???????????¨???true
			if (Character.isUpperCase(c)) {
				//?°????????????????
				//String???????????´???????°????????????????
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				//??§???????????????
				//String???????????´????????§???????????????
				sb.append(String.valueOf(c).toUpperCase());
			}
		} {
			c = str.charAt(count);
			// ??§???????????¨???true
			if (Character.isUpperCase(c)) {
				//?°????????????????
				//String???????????´???????°????????????????
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				//??§???????????????
				//String???????????´????????§???????????????
				sb.append(String.valueOf(c).toUpperCase());
			}
		} c = str.charAt(count) c str.charAt(count) str.charAt str count if (Character.isUpperCase(c)) {
				//?°????????????????
				//String???????????´???????°????????????????
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				//??§???????????????
				//String???????????´????????§???????????????
				sb.append(String.valueOf(c).toUpperCase());
			} Character.isUpperCase(c) Character.isUpperCase Character c {
				//?°????????????????
				//String???????????´???????°????????????????
				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 {
				//??§???????????????
				//String???????????´????????§???????????????
				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 System.out.println(new String(sb)) System.out.println System.out System System.out new String(sb) String args[] args public class Main {
	public static void main(String args[])throws IOException {
		//BufferedReader??§??????????????????input??????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String str;
		str = br.readLine();
		char c;
		
		//??????????????????????????????
		for(int count=0;count<str.length();count++){
			c = str.charAt(count);
			// ??§???????????¨???true
			if (Character.isUpperCase(c)) {
				//?°????????????????
				//String???????????´???????°????????????????
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				//??§???????????????
				//String???????????´????????§???????????????
				sb.append(String.valueOf(c).toUpperCase());
			}
		}
		System.out.println(new String(sb));
	}
} public class Main {
	public static void main(String args[])throws IOException {
		//BufferedReader??§??????????????????input??????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String str;
		str = br.readLine();
		char c;
		
		//??????????????????????????????
		for(int count=0;count<str.length();count++){
			c = str.charAt(count);
			// ??§???????????¨???true
			if (Character.isUpperCase(c)) {
				//?°????????????????
				//String???????????´???????°????????????????
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				//??§???????????????
				//String???????????´????????§???????????????
				sb.append(String.valueOf(c).toUpperCase());
			}
		}
		System.out.println(new String(sb));
	}
} Main


import java.util.*;
import java.io.*;

public class Main {
	public static void main(String args[])throws IOException {
		//BufferedReader??§??????????????????input??????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String str;
		str = br.readLine();
		char c;
		
		//??????????????????????????????
		for(int count=0;count<str.length();count++){
			c = str.charAt(count);
			// ??§???????????¨???true
			if (Character.isUpperCase(c)) {
				//?°????????????????
				//String???????????´???????°????????????????
				sb.append(String.valueOf(c).toLowerCase());
			} else {
				//??§???????????????
				//String???????????´????????§???????????????
				sb.append(String.valueOf(c).toUpperCase());
			}
		}
		System.out.println(new String(sb));
	}
}