import java.util.Scanner;

public class Main{
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		String s= sc.nextLine();
		char c[]= s.toCharArray();

		for(int i=0;i<c.length;++i){
			if(Character.isUpperCase(c[i])) c[i]=Character.toLowerCase(c[i]);
			else if(Character.isLowerCase(c[i])) c[i]=Character.toUpperCase(c[i]);
		}

		StringBuilder sb = new StringBuilder(new String(c));

		System.out.println(sb.toString());


	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		String s= sc.nextLine();
		char c[]= s.toCharArray();

		for(int i=0;i<c.length;++i){
			if(Character.isUpperCase(c[i])) c[i]=Character.toLowerCase(c[i]);
			else if(Character.isLowerCase(c[i])) c[i]=Character.toUpperCase(c[i]);
		}

		StringBuilder sb = new StringBuilder(new String(c));

		System.out.println(sb.toString());


	}
} Main public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		String s= sc.nextLine();
		char c[]= s.toCharArray();

		for(int i=0;i<c.length;++i){
			if(Character.isUpperCase(c[i])) c[i]=Character.toLowerCase(c[i]);
			else if(Character.isLowerCase(c[i])) c[i]=Character.toUpperCase(c[i]);
		}

		StringBuilder sb = new StringBuilder(new String(c));

		System.out.println(sb.toString());


	} main {

		Scanner sc = new Scanner(System.in);

		String s= sc.nextLine();
		char c[]= s.toCharArray();

		for(int i=0;i<c.length;++i){
			if(Character.isUpperCase(c[i])) c[i]=Character.toLowerCase(c[i]);
			else if(Character.isLowerCase(c[i])) c[i]=Character.toUpperCase(c[i]);
		}

		StringBuilder sb = new StringBuilder(new String(c));

		System.out.println(sb.toString());


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

		Scanner sc = new Scanner(System.in);

		String s= sc.nextLine();
		char c[]= s.toCharArray();

		for(int i=0;i<c.length;++i){
			if(Character.isUpperCase(c[i])) c[i]=Character.toLowerCase(c[i]);
			else if(Character.isLowerCase(c[i])) c[i]=Character.toUpperCase(c[i]);
		}

		StringBuilder sb = new StringBuilder(new String(c));

		System.out.println(sb.toString());


	}
} public class Main{
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		String s= sc.nextLine();
		char c[]= s.toCharArray();

		for(int i=0;i<c.length;++i){
			if(Character.isUpperCase(c[i])) c[i]=Character.toLowerCase(c[i]);
			else if(Character.isLowerCase(c[i])) c[i]=Character.toUpperCase(c[i]);
		}

		StringBuilder sb = new StringBuilder(new String(c));

		System.out.println(sb.toString());


	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		String s= sc.nextLine();
		char c[]= s.toCharArray();

		for(int i=0;i<c.length;++i){
			if(Character.isUpperCase(c[i])) c[i]=Character.toLowerCase(c[i]);
			else if(Character.isLowerCase(c[i])) c[i]=Character.toUpperCase(c[i]);
		}

		StringBuilder sb = new StringBuilder(new String(c));

		System.out.println(sb.toString());


	}
}
