import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String tmp = sc.nextLine();
		char[] c = tmp.toCharArray();
		for(int i = 0; i < c.length; i++){
			if(c[i] >= 'a' && c[i] <= 'z' ){
				c[i] -= 32;
			}else if(c[i] >= 'A' && c[i] <= 'Z'){
				c[i] += 32;
			}
		}
		System.out.println(String.valueOf(c));
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String tmp = sc.nextLine();
		char[] c = tmp.toCharArray();
		for(int i = 0; i < c.length; i++){
			if(c[i] >= 'a' && c[i] <= 'z' ){
				c[i] -= 32;
			}else if(c[i] >= 'A' && c[i] <= 'Z'){
				c[i] += 32;
			}
		}
		System.out.println(String.valueOf(c));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String tmp = sc.nextLine();
		char[] c = tmp.toCharArray();
		for(int i = 0; i < c.length; i++){
			if(c[i] >= 'a' && c[i] <= 'z' ){
				c[i] -= 32;
			}else if(c[i] >= 'A' && c[i] <= 'Z'){
				c[i] += 32;
			}
		}
		System.out.println(String.valueOf(c));
	} main {
		Scanner sc = new Scanner(System.in);
		String tmp = sc.nextLine();
		char[] c = tmp.toCharArray();
		for(int i = 0; i < c.length; i++){
			if(c[i] >= 'a' && c[i] <= 'z' ){
				c[i] -= 32;
			}else if(c[i] >= 'A' && c[i] <= 'Z'){
				c[i] += 32;
			}
		}
		System.out.println(String.valueOf(c));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String tmp = sc.nextLine(); tmp sc.nextLine() sc.nextLine sc char[] c = tmp.toCharArray(); c tmp.toCharArray() tmp.toCharArray tmp for(int i = 0; i < c.length; i++){
			if(c[i] >= 'a' && c[i] <= 'z' ){
				c[i] -= 32;
			}else if(c[i] >= 'A' && c[i] <= 'Z'){
				c[i] += 32;
			}
		} int i = 0; int i = 0; i 0 i < c.length i c.length c c.length i++ i++ i {
			if(c[i] >= 'a' && c[i] <= 'z' ){
				c[i] -= 32;
			}else if(c[i] >= 'A' && c[i] <= 'Z'){
				c[i] += 32;
			}
		} {
			if(c[i] >= 'a' && c[i] <= 'z' ){
				c[i] -= 32;
			}else if(c[i] >= 'A' && c[i] <= 'Z'){
				c[i] += 32;
			}
		} if(c[i] >= 'a' && c[i] <= 'z' ){
				c[i] -= 32;
			}else if(c[i] >= 'A' && c[i] <= 'Z'){
				c[i] += 32;
			} c[i] >= 'a' && c[i] <= 'z' c[i] >= 'a' c[i] c i 'a' c[i] <= 'z' c[i] c i 'z' {
				c[i] -= 32;
			} c[i] -= 32 c[i] c i 32 if(c[i] >= 'A' && c[i] <= 'Z'){
				c[i] += 32;
			} c[i] >= 'A' && c[i] <= 'Z' c[i] >= 'A' c[i] c i 'A' c[i] <= 'Z' c[i] c i 'Z' {
				c[i] += 32;
			} c[i] += 32 c[i] c i 32 System.out.println(String.valueOf(c)) System.out.println System.out System System.out String.valueOf(c) String.valueOf String c String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String tmp = sc.nextLine();
		char[] c = tmp.toCharArray();
		for(int i = 0; i < c.length; i++){
			if(c[i] >= 'a' && c[i] <= 'z' ){
				c[i] -= 32;
			}else if(c[i] >= 'A' && c[i] <= 'Z'){
				c[i] += 32;
			}
		}
		System.out.println(String.valueOf(c));
	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String tmp = sc.nextLine();
		char[] c = tmp.toCharArray();
		for(int i = 0; i < c.length; i++){
			if(c[i] >= 'a' && c[i] <= 'z' ){
				c[i] -= 32;
			}else if(c[i] >= 'A' && c[i] <= 'Z'){
				c[i] += 32;
			}
		}
		System.out.println(String.valueOf(c));
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String tmp = sc.nextLine();
		char[] c = tmp.toCharArray();
		for(int i = 0; i < c.length; i++){
			if(c[i] >= 'a' && c[i] <= 'z' ){
				c[i] -= 32;
			}else if(c[i] >= 'A' && c[i] <= 'Z'){
				c[i] += 32;
			}
		}
		System.out.println(String.valueOf(c));
	}
}