import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		sc.close();
		char c;
		StringBuilder sb = new StringBuilder();
		for (int i =0; i < str.length(); i++) {
			c = str.charAt(i);
			if (Character.isUpperCase(c)) {
				c = Character.toLowerCase(c);
			} else if (Character.isLowerCase(c)) {
				c = Character.toUpperCase(c);
			}
			sb.append(c);
		}
		System.out.println(sb);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		sc.close();
		char c;
		StringBuilder sb = new StringBuilder();
		for (int i =0; i < str.length(); i++) {
			c = str.charAt(i);
			if (Character.isUpperCase(c)) {
				c = Character.toLowerCase(c);
			} else if (Character.isLowerCase(c)) {
				c = Character.toUpperCase(c);
			}
			sb.append(c);
		}
		System.out.println(sb);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		sc.close();
		char c;
		StringBuilder sb = new StringBuilder();
		for (int i =0; i < str.length(); i++) {
			c = str.charAt(i);
			if (Character.isUpperCase(c)) {
				c = Character.toLowerCase(c);
			} else if (Character.isLowerCase(c)) {
				c = Character.toUpperCase(c);
			}
			sb.append(c);
		}
		System.out.println(sb);
	} main {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		sc.close();
		char c;
		StringBuilder sb = new StringBuilder();
		for (int i =0; i < str.length(); i++) {
			c = str.charAt(i);
			if (Character.isUpperCase(c)) {
				c = Character.toLowerCase(c);
			} else if (Character.isLowerCase(c)) {
				c = Character.toUpperCase(c);
			}
			sb.append(c);
		}
		System.out.println(sb);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc sc.close() sc.close sc char c; c StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int i =0; i < str.length(); i++) {
			c = str.charAt(i);
			if (Character.isUpperCase(c)) {
				c = Character.toLowerCase(c);
			} else if (Character.isLowerCase(c)) {
				c = Character.toUpperCase(c);
			}
			sb.append(c);
		} int i =0; int i =0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
			c = str.charAt(i);
			if (Character.isUpperCase(c)) {
				c = Character.toLowerCase(c);
			} else if (Character.isLowerCase(c)) {
				c = Character.toUpperCase(c);
			}
			sb.append(c);
		} {
			c = str.charAt(i);
			if (Character.isUpperCase(c)) {
				c = Character.toLowerCase(c);
			} else if (Character.isLowerCase(c)) {
				c = Character.toUpperCase(c);
			}
			sb.append(c);
		} c = str.charAt(i) c str.charAt(i) str.charAt str i if (Character.isUpperCase(c)) {
				c = Character.toLowerCase(c);
			} else if (Character.isLowerCase(c)) {
				c = Character.toUpperCase(c);
			} Character.isUpperCase(c) Character.isUpperCase Character c {
				c = Character.toLowerCase(c);
			} c = Character.toLowerCase(c) c Character.toLowerCase(c) Character.toLowerCase Character c if (Character.isLowerCase(c)) {
				c = Character.toUpperCase(c);
			} Character.isLowerCase(c) Character.isLowerCase Character c {
				c = Character.toUpperCase(c);
			} c = Character.toUpperCase(c) c Character.toUpperCase(c) Character.toUpperCase Character c sb.append(c) sb.append sb c 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 sc = new Scanner(System.in);
		String str = sc.nextLine();
		sc.close();
		char c;
		StringBuilder sb = new StringBuilder();
		for (int i =0; i < str.length(); i++) {
			c = str.charAt(i);
			if (Character.isUpperCase(c)) {
				c = Character.toLowerCase(c);
			} else if (Character.isLowerCase(c)) {
				c = Character.toUpperCase(c);
			}
			sb.append(c);
		}
		System.out.println(sb);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		sc.close();
		char c;
		StringBuilder sb = new StringBuilder();
		for (int i =0; i < str.length(); i++) {
			c = str.charAt(i);
			if (Character.isUpperCase(c)) {
				c = Character.toLowerCase(c);
			} else if (Character.isLowerCase(c)) {
				c = Character.toUpperCase(c);
			}
			sb.append(c);
		}
		System.out.println(sb);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		sc.close();
		char c;
		StringBuilder sb = new StringBuilder();
		for (int i =0; i < str.length(); i++) {
			c = str.charAt(i);
			if (Character.isUpperCase(c)) {
				c = Character.toLowerCase(c);
			} else if (Character.isLowerCase(c)) {
				c = Character.toUpperCase(c);
			}
			sb.append(c);
		}
		System.out.println(sb);
	}
}