import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = new String();
		s = sc.nextLine();
		char c[] = new char[s.length()];
		c = s.toCharArray();
		for(int i=0; i<s.length(); i++){
			if(Character.isLowerCase(c[i])){
				System.out.print(Character.toUpperCase(c[i]));
			} else if(Character.isUpperCase(c[i])){
				System.out.print(Character.toLowerCase(c[i]));
			} else {
				System.out.print(c[i]);
			}
		}
		System.out.println();
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = new String();
		s = sc.nextLine();
		char c[] = new char[s.length()];
		c = s.toCharArray();
		for(int i=0; i<s.length(); i++){
			if(Character.isLowerCase(c[i])){
				System.out.print(Character.toUpperCase(c[i]));
			} else if(Character.isUpperCase(c[i])){
				System.out.print(Character.toLowerCase(c[i]));
			} else {
				System.out.print(c[i]);
			}
		}
		System.out.println();
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = new String();
		s = sc.nextLine();
		char c[] = new char[s.length()];
		c = s.toCharArray();
		for(int i=0; i<s.length(); i++){
			if(Character.isLowerCase(c[i])){
				System.out.print(Character.toUpperCase(c[i]));
			} else if(Character.isUpperCase(c[i])){
				System.out.print(Character.toLowerCase(c[i]));
			} else {
				System.out.print(c[i]);
			}
		}
		System.out.println();
	} main {
		Scanner sc = new Scanner(System.in);
		String s = new String();
		s = sc.nextLine();
		char c[] = new char[s.length()];
		c = s.toCharArray();
		for(int i=0; i<s.length(); i++){
			if(Character.isLowerCase(c[i])){
				System.out.print(Character.toUpperCase(c[i]));
			} else if(Character.isUpperCase(c[i])){
				System.out.print(Character.toLowerCase(c[i]));
			} else {
				System.out.print(c[i]);
			}
		}
		System.out.println();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = new String(); s new String() s = sc.nextLine() s sc.nextLine() sc.nextLine sc char c[] = new char[s.length()]; c new char[s.length()] s.length() s.length s c = s.toCharArray() c s.toCharArray() s.toCharArray s for(int i=0; i<s.length(); i++){
			if(Character.isLowerCase(c[i])){
				System.out.print(Character.toUpperCase(c[i]));
			} else if(Character.isUpperCase(c[i])){
				System.out.print(Character.toLowerCase(c[i]));
			} else {
				System.out.print(c[i]);
			}
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			if(Character.isLowerCase(c[i])){
				System.out.print(Character.toUpperCase(c[i]));
			} else if(Character.isUpperCase(c[i])){
				System.out.print(Character.toLowerCase(c[i]));
			} else {
				System.out.print(c[i]);
			}
		} {
			if(Character.isLowerCase(c[i])){
				System.out.print(Character.toUpperCase(c[i]));
			} else if(Character.isUpperCase(c[i])){
				System.out.print(Character.toLowerCase(c[i]));
			} else {
				System.out.print(c[i]);
			}
		} if(Character.isLowerCase(c[i])){
				System.out.print(Character.toUpperCase(c[i]));
			} else if(Character.isUpperCase(c[i])){
				System.out.print(Character.toLowerCase(c[i]));
			} else {
				System.out.print(c[i]);
			} Character.isLowerCase(c[i]) Character.isLowerCase Character c[i] c i {
				System.out.print(Character.toUpperCase(c[i]));
			} System.out.print(Character.toUpperCase(c[i])) System.out.print System.out System System.out Character.toUpperCase(c[i]) Character.toUpperCase Character c[i] c i if(Character.isUpperCase(c[i])){
				System.out.print(Character.toLowerCase(c[i]));
			} else {
				System.out.print(c[i]);
			} Character.isUpperCase(c[i]) Character.isUpperCase Character c[i] c i {
				System.out.print(Character.toLowerCase(c[i]));
			} System.out.print(Character.toLowerCase(c[i])) System.out.print System.out System System.out Character.toLowerCase(c[i]) Character.toLowerCase Character c[i] c i {
				System.out.print(c[i]);
			} System.out.print(c[i]) System.out.print System.out System System.out c[i] c i System.out.println() System.out.println System.out System System.out String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = new String();
		s = sc.nextLine();
		char c[] = new char[s.length()];
		c = s.toCharArray();
		for(int i=0; i<s.length(); i++){
			if(Character.isLowerCase(c[i])){
				System.out.print(Character.toUpperCase(c[i]));
			} else if(Character.isUpperCase(c[i])){
				System.out.print(Character.toLowerCase(c[i]));
			} else {
				System.out.print(c[i]);
			}
		}
		System.out.println();
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = new String();
		s = sc.nextLine();
		char c[] = new char[s.length()];
		c = s.toCharArray();
		for(int i=0; i<s.length(); i++){
			if(Character.isLowerCase(c[i])){
				System.out.print(Character.toUpperCase(c[i]));
			} else if(Character.isUpperCase(c[i])){
				System.out.print(Character.toLowerCase(c[i]));
			} else {
				System.out.print(c[i]);
			}
		}
		System.out.println();
	}
} Main
import java.util.Scanner;

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