import java.util.*;
import java.lang.*;

class Main{
	public static void main(String[] args){
		StringBuilder sb= new StringBuilder();
		Scanner sc= new Scanner(System.in);
		String line = sc.nextLine();
		char[] c =line.toCharArray();
		for(int i=0;i<line.length();i++){
			if(c[i]>='A' && c[i]<='Z'){
				sb.append(line.substring(i,i+1).toLowerCase());				
			}else if(c[i]>='a' && c[i]<='z'){
				sb.append(line.substring(i,i+1).toUpperCase());
			}else{
				sb.append(line.substring(i,i+1));
			}
		}
		System.out.println(sb.toString());
	}
} import java.util.*; util.* java import java.lang.*; lang.* java class Main{
	public static void main(String[] args){
		StringBuilder sb= new StringBuilder();
		Scanner sc= new Scanner(System.in);
		String line = sc.nextLine();
		char[] c =line.toCharArray();
		for(int i=0;i<line.length();i++){
			if(c[i]>='A' && c[i]<='Z'){
				sb.append(line.substring(i,i+1).toLowerCase());				
			}else if(c[i]>='a' && c[i]<='z'){
				sb.append(line.substring(i,i+1).toUpperCase());
			}else{
				sb.append(line.substring(i,i+1));
			}
		}
		System.out.println(sb.toString());
	}
} Main public static void main(String[] args){
		StringBuilder sb= new StringBuilder();
		Scanner sc= new Scanner(System.in);
		String line = sc.nextLine();
		char[] c =line.toCharArray();
		for(int i=0;i<line.length();i++){
			if(c[i]>='A' && c[i]<='Z'){
				sb.append(line.substring(i,i+1).toLowerCase());				
			}else if(c[i]>='a' && c[i]<='z'){
				sb.append(line.substring(i,i+1).toUpperCase());
			}else{
				sb.append(line.substring(i,i+1));
			}
		}
		System.out.println(sb.toString());
	} main {
		StringBuilder sb= new StringBuilder();
		Scanner sc= new Scanner(System.in);
		String line = sc.nextLine();
		char[] c =line.toCharArray();
		for(int i=0;i<line.length();i++){
			if(c[i]>='A' && c[i]<='Z'){
				sb.append(line.substring(i,i+1).toLowerCase());				
			}else if(c[i]>='a' && c[i]<='z'){
				sb.append(line.substring(i,i+1).toUpperCase());
			}else{
				sb.append(line.substring(i,i+1));
			}
		}
		System.out.println(sb.toString());
	} StringBuilder sb= new StringBuilder(); sb new StringBuilder() Scanner sc= new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc char[] c =line.toCharArray(); c line.toCharArray() line.toCharArray line for(int i=0;i<line.length();i++){
			if(c[i]>='A' && c[i]<='Z'){
				sb.append(line.substring(i,i+1).toLowerCase());				
			}else if(c[i]>='a' && c[i]<='z'){
				sb.append(line.substring(i,i+1).toUpperCase());
			}else{
				sb.append(line.substring(i,i+1));
			}
		} int i=0; int i=0; i 0 i<line.length() i line.length() line.length line i++ i++ i {
			if(c[i]>='A' && c[i]<='Z'){
				sb.append(line.substring(i,i+1).toLowerCase());				
			}else if(c[i]>='a' && c[i]<='z'){
				sb.append(line.substring(i,i+1).toUpperCase());
			}else{
				sb.append(line.substring(i,i+1));
			}
		} {
			if(c[i]>='A' && c[i]<='Z'){
				sb.append(line.substring(i,i+1).toLowerCase());				
			}else if(c[i]>='a' && c[i]<='z'){
				sb.append(line.substring(i,i+1).toUpperCase());
			}else{
				sb.append(line.substring(i,i+1));
			}
		} if(c[i]>='A' && c[i]<='Z'){
				sb.append(line.substring(i,i+1).toLowerCase());				
			}else if(c[i]>='a' && c[i]<='z'){
				sb.append(line.substring(i,i+1).toUpperCase());
			}else{
				sb.append(line.substring(i,i+1));
			} c[i]>='A' && c[i]<='Z' c[i]>='A' c[i] c i 'A' c[i]<='Z' c[i] c i 'Z' {
				sb.append(line.substring(i,i+1).toLowerCase());				
			} sb.append(line.substring(i,i+1).toLowerCase()) sb.append sb line.substring(i,i+1).toLowerCase() line.substring(i,i+1).toLowerCase line.substring(i,i+1) line.substring line i i+1 i 1 if(c[i]>='a' && c[i]<='z'){
				sb.append(line.substring(i,i+1).toUpperCase());
			}else{
				sb.append(line.substring(i,i+1));
			} c[i]>='a' && c[i]<='z' c[i]>='a' c[i] c i 'a' c[i]<='z' c[i] c i 'z' {
				sb.append(line.substring(i,i+1).toUpperCase());
			} sb.append(line.substring(i,i+1).toUpperCase()) sb.append sb line.substring(i,i+1).toUpperCase() line.substring(i,i+1).toUpperCase line.substring(i,i+1) line.substring line i i+1 i 1 {
				sb.append(line.substring(i,i+1));
			} sb.append(line.substring(i,i+1)) sb.append sb line.substring(i,i+1) line.substring line i i+1 i 1 System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb String[] args args
import java.util.*;
import java.lang.*;

class Main{
	public static void main(String[] args){
		StringBuilder sb= new StringBuilder();
		Scanner sc= new Scanner(System.in);
		String line = sc.nextLine();
		char[] c =line.toCharArray();
		for(int i=0;i<line.length();i++){
			if(c[i]>='A' && c[i]<='Z'){
				sb.append(line.substring(i,i+1).toLowerCase());				
			}else if(c[i]>='a' && c[i]<='z'){
				sb.append(line.substring(i,i+1).toUpperCase());
			}else{
				sb.append(line.substring(i,i+1));
			}
		}
		System.out.println(sb.toString());
	}
}