import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		String str=in.nextLine(); char[] C=str.toCharArray();
		
		for(int i=0;i<C.length;i++) {
			if(C[i]>=65 && C[i]<=90)C[i]+=32;
			else if(C[i]>=97 && C[i]<=122)C[i]-=32;
			out.print(C[i]);
		}
		out.println();
		out.flush();
	}

}
 import java.util.*; util.* java import java.io.*; io.* java public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		String str=in.nextLine(); char[] C=str.toCharArray();
		
		for(int i=0;i<C.length;i++) {
			if(C[i]>=65 && C[i]<=90)C[i]+=32;
			else if(C[i]>=97 && C[i]<=122)C[i]-=32;
			out.print(C[i]);
		}
		out.println();
		out.flush();
	}

} Main public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		String str=in.nextLine(); char[] C=str.toCharArray();
		
		for(int i=0;i<C.length;i++) {
			if(C[i]>=65 && C[i]<=90)C[i]+=32;
			else if(C[i]>=97 && C[i]<=122)C[i]-=32;
			out.print(C[i]);
		}
		out.println();
		out.flush();
	} main {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		String str=in.nextLine(); char[] C=str.toCharArray();
		
		for(int i=0;i<C.length;i++) {
			if(C[i]>=65 && C[i]<=90)C[i]+=32;
			else if(C[i]>=97 && C[i]<=122)C[i]-=32;
			out.print(C[i]);
		}
		out.println();
		out.flush();
	} Scanner in=new Scanner(System.in); in new Scanner(System.in) PrintWriter out=new PrintWriter(System.out); out new PrintWriter(System.out) String str=in.nextLine(); str in.nextLine() in.nextLine in char[] C=str.toCharArray(); C str.toCharArray() str.toCharArray str for(int i=0;i<C.length;i++) {
			if(C[i]>=65 && C[i]<=90)C[i]+=32;
			else if(C[i]>=97 && C[i]<=122)C[i]-=32;
			out.print(C[i]);
		} int i=0; int i=0; i 0 i<C.length i C.length C C.length i++ i++ i {
			if(C[i]>=65 && C[i]<=90)C[i]+=32;
			else if(C[i]>=97 && C[i]<=122)C[i]-=32;
			out.print(C[i]);
		} {
			if(C[i]>=65 && C[i]<=90)C[i]+=32;
			else if(C[i]>=97 && C[i]<=122)C[i]-=32;
			out.print(C[i]);
		} if(C[i]>=65 && C[i]<=90)C[i]+=32;
			else if(C[i]>=97 && C[i]<=122)C[i]-=32; C[i]>=65 && C[i]<=90 C[i]>=65 C[i] C i 65 C[i]<=90 C[i] C i 90 C[i]+=32 C[i] C i 32 if(C[i]>=97 && C[i]<=122)C[i]-=32; C[i]>=97 && C[i]<=122 C[i]>=97 C[i] C i 97 C[i]<=122 C[i] C i 122 C[i]-=32 C[i] C i 32 out.print(C[i]) out.print out C[i] C i out.println() out.println out out.flush() out.flush out String[] args args public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		String str=in.nextLine(); char[] C=str.toCharArray();
		
		for(int i=0;i<C.length;i++) {
			if(C[i]>=65 && C[i]<=90)C[i]+=32;
			else if(C[i]>=97 && C[i]<=122)C[i]-=32;
			out.print(C[i]);
		}
		out.println();
		out.flush();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		String str=in.nextLine(); char[] C=str.toCharArray();
		
		for(int i=0;i<C.length;i++) {
			if(C[i]>=65 && C[i]<=90)C[i]+=32;
			else if(C[i]>=97 && C[i]<=122)C[i]-=32;
			out.print(C[i]);
		}
		out.println();
		out.flush();
	}

} Main
import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		String str=in.nextLine(); char[] C=str.toCharArray();
		
		for(int i=0;i<C.length;i++) {
			if(C[i]>=65 && C[i]<=90)C[i]+=32;
			else if(C[i]>=97 && C[i]<=122)C[i]-=32;
			out.print(C[i]);
		}
		out.println();
		out.flush();
	}

}

