import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String str;
		char[] chr= new char[1200];

		str=scan.nextLine();
		chr=str.toCharArray();

		for(int i=0;i<chr.length;i++){
			str=String.valueOf(chr[i]);
		 if(Character.isUpperCase(chr[i])){
			 str=str.toLowerCase();
		}else if(Character.isLowerCase(chr[i])){
			str=str.toUpperCase();
		}
		  chr[i]=str.charAt(0);
		}

		str=String.copyValueOf(chr);
		System.out.println(str);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String str;
		char[] chr= new char[1200];

		str=scan.nextLine();
		chr=str.toCharArray();

		for(int i=0;i<chr.length;i++){
			str=String.valueOf(chr[i]);
		 if(Character.isUpperCase(chr[i])){
			 str=str.toLowerCase();
		}else if(Character.isLowerCase(chr[i])){
			str=str.toUpperCase();
		}
		  chr[i]=str.charAt(0);
		}

		str=String.copyValueOf(chr);
		System.out.println(str);
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String str;
		char[] chr= new char[1200];

		str=scan.nextLine();
		chr=str.toCharArray();

		for(int i=0;i<chr.length;i++){
			str=String.valueOf(chr[i]);
		 if(Character.isUpperCase(chr[i])){
			 str=str.toLowerCase();
		}else if(Character.isLowerCase(chr[i])){
			str=str.toUpperCase();
		}
		  chr[i]=str.charAt(0);
		}

		str=String.copyValueOf(chr);
		System.out.println(str);
	} main {
		Scanner scan = new Scanner(System.in);
		String str;
		char[] chr= new char[1200];

		str=scan.nextLine();
		chr=str.toCharArray();

		for(int i=0;i<chr.length;i++){
			str=String.valueOf(chr[i]);
		 if(Character.isUpperCase(chr[i])){
			 str=str.toLowerCase();
		}else if(Character.isLowerCase(chr[i])){
			str=str.toUpperCase();
		}
		  chr[i]=str.charAt(0);
		}

		str=String.copyValueOf(chr);
		System.out.println(str);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String str; str char[] chr= new char[1200]; chr new char[1200] 1200 str=scan.nextLine() str scan.nextLine() scan.nextLine scan chr=str.toCharArray() chr str.toCharArray() str.toCharArray str for(int i=0;i<chr.length;i++){
			str=String.valueOf(chr[i]);
		 if(Character.isUpperCase(chr[i])){
			 str=str.toLowerCase();
		}else if(Character.isLowerCase(chr[i])){
			str=str.toUpperCase();
		}
		  chr[i]=str.charAt(0);
		} int i=0; int i=0; i 0 i<chr.length i chr.length chr chr.length i++ i++ i {
			str=String.valueOf(chr[i]);
		 if(Character.isUpperCase(chr[i])){
			 str=str.toLowerCase();
		}else if(Character.isLowerCase(chr[i])){
			str=str.toUpperCase();
		}
		  chr[i]=str.charAt(0);
		} {
			str=String.valueOf(chr[i]);
		 if(Character.isUpperCase(chr[i])){
			 str=str.toLowerCase();
		}else if(Character.isLowerCase(chr[i])){
			str=str.toUpperCase();
		}
		  chr[i]=str.charAt(0);
		} str=String.valueOf(chr[i]) str String.valueOf(chr[i]) String.valueOf String chr[i] chr i if(Character.isUpperCase(chr[i])){
			 str=str.toLowerCase();
		}else if(Character.isLowerCase(chr[i])){
			str=str.toUpperCase();
		} Character.isUpperCase(chr[i]) Character.isUpperCase Character chr[i] chr i {
			 str=str.toLowerCase();
		} str=str.toLowerCase() str str.toLowerCase() str.toLowerCase str if(Character.isLowerCase(chr[i])){
			str=str.toUpperCase();
		} Character.isLowerCase(chr[i]) Character.isLowerCase Character chr[i] chr i {
			str=str.toUpperCase();
		} str=str.toUpperCase() str str.toUpperCase() str.toUpperCase str chr[i]=str.charAt(0) chr[i] chr i str.charAt(0) str.charAt str 0 str=String.copyValueOf(chr) str String.copyValueOf(chr) String.copyValueOf String chr System.out.println(str) System.out.println System.out System System.out str String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String str;
		char[] chr= new char[1200];

		str=scan.nextLine();
		chr=str.toCharArray();

		for(int i=0;i<chr.length;i++){
			str=String.valueOf(chr[i]);
		 if(Character.isUpperCase(chr[i])){
			 str=str.toLowerCase();
		}else if(Character.isLowerCase(chr[i])){
			str=str.toUpperCase();
		}
		  chr[i]=str.charAt(0);
		}

		str=String.copyValueOf(chr);
		System.out.println(str);
	}

} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String str;
		char[] chr= new char[1200];

		str=scan.nextLine();
		chr=str.toCharArray();

		for(int i=0;i<chr.length;i++){
			str=String.valueOf(chr[i]);
		 if(Character.isUpperCase(chr[i])){
			 str=str.toLowerCase();
		}else if(Character.isLowerCase(chr[i])){
			str=str.toUpperCase();
		}
		  chr[i]=str.charAt(0);
		}

		str=String.copyValueOf(chr);
		System.out.println(str);
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String str;
		char[] chr= new char[1200];

		str=scan.nextLine();
		chr=str.toCharArray();

		for(int i=0;i<chr.length;i++){
			str=String.valueOf(chr[i]);
		 if(Character.isUpperCase(chr[i])){
			 str=str.toLowerCase();
		}else if(Character.isLowerCase(chr[i])){
			str=str.toUpperCase();
		}
		  chr[i]=str.charAt(0);
		}

		str=String.copyValueOf(chr);
		System.out.println(str);
	}

}