import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		StringBuilder sb = new StringBuilder(sc.nextLine());
		for (int i=0; i<sb.length(); i++) {
			char c = sb.charAt(i);
			if (c>=65&&c<=90) {sb.replace(i,i+1,String.valueOf(c).toLowerCase());}
			else if (c>=97&&c<=122) {sb.replace(i,i+1,String.valueOf(c).toUpperCase());}
		}
		System.out.println(sb);
	}
} import java.util.*; util.* java public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		StringBuilder sb = new StringBuilder(sc.nextLine());
		for (int i=0; i<sb.length(); i++) {
			char c = sb.charAt(i);
			if (c>=65&&c<=90) {sb.replace(i,i+1,String.valueOf(c).toLowerCase());}
			else if (c>=97&&c<=122) {sb.replace(i,i+1,String.valueOf(c).toUpperCase());}
		}
		System.out.println(sb);
	}
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
		StringBuilder sb = new StringBuilder(sc.nextLine());
		for (int i=0; i<sb.length(); i++) {
			char c = sb.charAt(i);
			if (c>=65&&c<=90) {sb.replace(i,i+1,String.valueOf(c).toLowerCase());}
			else if (c>=97&&c<=122) {sb.replace(i,i+1,String.valueOf(c).toUpperCase());}
		}
		System.out.println(sb);
	} main {
		StringBuilder sb = new StringBuilder(sc.nextLine());
		for (int i=0; i<sb.length(); i++) {
			char c = sb.charAt(i);
			if (c>=65&&c<=90) {sb.replace(i,i+1,String.valueOf(c).toLowerCase());}
			else if (c>=97&&c<=122) {sb.replace(i,i+1,String.valueOf(c).toUpperCase());}
		}
		System.out.println(sb);
	} StringBuilder sb = new StringBuilder(sc.nextLine()); sb new StringBuilder(sc.nextLine()) for (int i=0; i<sb.length(); i++) {
			char c = sb.charAt(i);
			if (c>=65&&c<=90) {sb.replace(i,i+1,String.valueOf(c).toLowerCase());}
			else if (c>=97&&c<=122) {sb.replace(i,i+1,String.valueOf(c).toUpperCase());}
		} int i=0; int i=0; i 0 i<sb.length() i sb.length() sb.length sb i++ i++ i {
			char c = sb.charAt(i);
			if (c>=65&&c<=90) {sb.replace(i,i+1,String.valueOf(c).toLowerCase());}
			else if (c>=97&&c<=122) {sb.replace(i,i+1,String.valueOf(c).toUpperCase());}
		} {
			char c = sb.charAt(i);
			if (c>=65&&c<=90) {sb.replace(i,i+1,String.valueOf(c).toLowerCase());}
			else if (c>=97&&c<=122) {sb.replace(i,i+1,String.valueOf(c).toUpperCase());}
		} char c = sb.charAt(i); c sb.charAt(i) sb.charAt sb i if (c>=65&&c<=90) {sb.replace(i,i+1,String.valueOf(c).toLowerCase());}
			else if (c>=97&&c<=122) {sb.replace(i,i+1,String.valueOf(c).toUpperCase());} c>=65&&c<=90 c>=65 c 65 c<=90 c 90 {sb.replace(i,i+1,String.valueOf(c).toLowerCase());} sb.replace(i,i+1,String.valueOf(c).toLowerCase()) sb.replace sb i i+1 i 1 String.valueOf(c).toLowerCase() String.valueOf(c).toLowerCase String.valueOf(c) String.valueOf String c if (c>=97&&c<=122) {sb.replace(i,i+1,String.valueOf(c).toUpperCase());} c>=97&&c<=122 c>=97 c 97 c<=122 c 122 {sb.replace(i,i+1,String.valueOf(c).toUpperCase());} sb.replace(i,i+1,String.valueOf(c).toUpperCase()) sb.replace sb i i+1 i 1 String.valueOf(c).toUpperCase() String.valueOf(c).toUpperCase String.valueOf(c) String.valueOf String c System.out.println(sb) System.out.println System.out System System.out sb String[] args args public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		StringBuilder sb = new StringBuilder(sc.nextLine());
		for (int i=0; i<sb.length(); i++) {
			char c = sb.charAt(i);
			if (c>=65&&c<=90) {sb.replace(i,i+1,String.valueOf(c).toLowerCase());}
			else if (c>=97&&c<=122) {sb.replace(i,i+1,String.valueOf(c).toUpperCase());}
		}
		System.out.println(sb);
	}
} public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		StringBuilder sb = new StringBuilder(sc.nextLine());
		for (int i=0; i<sb.length(); i++) {
			char c = sb.charAt(i);
			if (c>=65&&c<=90) {sb.replace(i,i+1,String.valueOf(c).toLowerCase());}
			else if (c>=97&&c<=122) {sb.replace(i,i+1,String.valueOf(c).toUpperCase());}
		}
		System.out.println(sb);
	}
} Main
import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		StringBuilder sb = new StringBuilder(sc.nextLine());
		for (int i=0; i<sb.length(); i++) {
			char c = sb.charAt(i);
			if (c>=65&&c<=90) {sb.replace(i,i+1,String.valueOf(c).toLowerCase());}
			else if (c>=97&&c<=122) {sb.replace(i,i+1,String.valueOf(c).toUpperCase());}
		}
		System.out.println(sb);
	}
}
