import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();
		String str = br.readLine();
		char[] moji = str.toCharArray();
		
		for(int i = 0; i < moji.length; i++) {
			if (Character.isUpperCase(moji[i])) {
				sb.append(Character.toLowerCase(moji[i]));
			} else {
				sb.append(Character.toUpperCase(moji[i]));
			}
		}
		System.out.println(sb.toString());
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();
		String str = br.readLine();
		char[] moji = str.toCharArray();
		
		for(int i = 0; i < moji.length; i++) {
			if (Character.isUpperCase(moji[i])) {
				sb.append(Character.toLowerCase(moji[i]));
			} else {
				sb.append(Character.toUpperCase(moji[i]));
			}
		}
		System.out.println(sb.toString());
	}
} Main public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();
		String str = br.readLine();
		char[] moji = str.toCharArray();
		
		for(int i = 0; i < moji.length; i++) {
			if (Character.isUpperCase(moji[i])) {
				sb.append(Character.toLowerCase(moji[i]));
			} else {
				sb.append(Character.toUpperCase(moji[i]));
			}
		}
		System.out.println(sb.toString());
	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();
		String str = br.readLine();
		char[] moji = str.toCharArray();
		
		for(int i = 0; i < moji.length; i++) {
			if (Character.isUpperCase(moji[i])) {
				sb.append(Character.toLowerCase(moji[i]));
			} else {
				sb.append(Character.toUpperCase(moji[i]));
			}
		}
		System.out.println(sb.toString());
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuffer sb = new StringBuffer(); sb new StringBuffer() String str = br.readLine(); str br.readLine() br.readLine br char[] moji = str.toCharArray(); moji str.toCharArray() str.toCharArray str for(int i = 0; i < moji.length; i++) {
			if (Character.isUpperCase(moji[i])) {
				sb.append(Character.toLowerCase(moji[i]));
			} else {
				sb.append(Character.toUpperCase(moji[i]));
			}
		} int i = 0; int i = 0; i 0 i < moji.length i moji.length moji moji.length i++ i++ i {
			if (Character.isUpperCase(moji[i])) {
				sb.append(Character.toLowerCase(moji[i]));
			} else {
				sb.append(Character.toUpperCase(moji[i]));
			}
		} {
			if (Character.isUpperCase(moji[i])) {
				sb.append(Character.toLowerCase(moji[i]));
			} else {
				sb.append(Character.toUpperCase(moji[i]));
			}
		} if (Character.isUpperCase(moji[i])) {
				sb.append(Character.toLowerCase(moji[i]));
			} else {
				sb.append(Character.toUpperCase(moji[i]));
			} Character.isUpperCase(moji[i]) Character.isUpperCase Character moji[i] moji i {
				sb.append(Character.toLowerCase(moji[i]));
			} sb.append(Character.toLowerCase(moji[i])) sb.append sb Character.toLowerCase(moji[i]) Character.toLowerCase Character moji[i] moji i {
				sb.append(Character.toUpperCase(moji[i]));
			} sb.append(Character.toUpperCase(moji[i])) sb.append sb Character.toUpperCase(moji[i]) Character.toUpperCase Character moji[i] moji i System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();
		String str = br.readLine();
		char[] moji = str.toCharArray();
		
		for(int i = 0; i < moji.length; i++) {
			if (Character.isUpperCase(moji[i])) {
				sb.append(Character.toLowerCase(moji[i]));
			} else {
				sb.append(Character.toUpperCase(moji[i]));
			}
		}
		System.out.println(sb.toString());
	}
}