import java.io.*;

class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		String str = buf.readLine();
		char[] a = str.toCharArray();

		for(int i=0; i<a.length; i++){
			if(Character.isLowerCase(a[i]))
				System.out.print(Character.toUpperCase(a[i]));
			else if(Character.isUpperCase(a[i]))
				System.out.print(Character.toLowerCase(a[i]));
			else 
				System.out.print(a[i]);
			if(i==a.length-1)
				System.out.println();

		}
	}
} import java.io.*; io.* java class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		String str = buf.readLine();
		char[] a = str.toCharArray();

		for(int i=0; i<a.length; i++){
			if(Character.isLowerCase(a[i]))
				System.out.print(Character.toUpperCase(a[i]));
			else if(Character.isUpperCase(a[i]))
				System.out.print(Character.toLowerCase(a[i]));
			else 
				System.out.print(a[i]);
			if(i==a.length-1)
				System.out.println();

		}
	}
} Main public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		String str = buf.readLine();
		char[] a = str.toCharArray();

		for(int i=0; i<a.length; i++){
			if(Character.isLowerCase(a[i]))
				System.out.print(Character.toUpperCase(a[i]));
			else if(Character.isUpperCase(a[i]))
				System.out.print(Character.toLowerCase(a[i]));
			else 
				System.out.print(a[i]);
			if(i==a.length-1)
				System.out.println();

		}
	} main {
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		String str = buf.readLine();
		char[] a = str.toCharArray();

		for(int i=0; i<a.length; i++){
			if(Character.isLowerCase(a[i]))
				System.out.print(Character.toUpperCase(a[i]));
			else if(Character.isUpperCase(a[i]))
				System.out.print(Character.toLowerCase(a[i]));
			else 
				System.out.print(a[i]);
			if(i==a.length-1)
				System.out.println();

		}
	} BufferedReader buf = new BufferedReader(new InputStreamReader(System.in)); buf new BufferedReader(new InputStreamReader(System.in)) String str = buf.readLine(); str buf.readLine() buf.readLine buf char[] a = str.toCharArray(); a str.toCharArray() str.toCharArray str for(int i=0; i<a.length; i++){
			if(Character.isLowerCase(a[i]))
				System.out.print(Character.toUpperCase(a[i]));
			else if(Character.isUpperCase(a[i]))
				System.out.print(Character.toLowerCase(a[i]));
			else 
				System.out.print(a[i]);
			if(i==a.length-1)
				System.out.println();

		} int i=0; int i=0; i 0 i<a.length i a.length a a.length i++ i++ i {
			if(Character.isLowerCase(a[i]))
				System.out.print(Character.toUpperCase(a[i]));
			else if(Character.isUpperCase(a[i]))
				System.out.print(Character.toLowerCase(a[i]));
			else 
				System.out.print(a[i]);
			if(i==a.length-1)
				System.out.println();

		} {
			if(Character.isLowerCase(a[i]))
				System.out.print(Character.toUpperCase(a[i]));
			else if(Character.isUpperCase(a[i]))
				System.out.print(Character.toLowerCase(a[i]));
			else 
				System.out.print(a[i]);
			if(i==a.length-1)
				System.out.println();

		} if(Character.isLowerCase(a[i]))
				System.out.print(Character.toUpperCase(a[i]));
			else if(Character.isUpperCase(a[i]))
				System.out.print(Character.toLowerCase(a[i]));
			else 
				System.out.print(a[i]); Character.isLowerCase(a[i]) Character.isLowerCase Character a[i] a i System.out.print(Character.toUpperCase(a[i])) System.out.print System.out System System.out Character.toUpperCase(a[i]) Character.toUpperCase Character a[i] a i if(Character.isUpperCase(a[i]))
				System.out.print(Character.toLowerCase(a[i]));
			else 
				System.out.print(a[i]); Character.isUpperCase(a[i]) Character.isUpperCase Character a[i] a i System.out.print(Character.toLowerCase(a[i])) System.out.print System.out System System.out Character.toLowerCase(a[i]) Character.toLowerCase Character a[i] a i System.out.print(a[i]) System.out.print System.out System System.out a[i] a i if(i==a.length-1)
				System.out.println(); i==a.length-1 i a.length-1 a.length a a.length 1 System.out.println() System.out.println System.out System System.out String args[] args
import java.io.*;

class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		String str = buf.readLine();
		char[] a = str.toCharArray();

		for(int i=0; i<a.length; i++){
			if(Character.isLowerCase(a[i]))
				System.out.print(Character.toUpperCase(a[i]));
			else if(Character.isUpperCase(a[i]))
				System.out.print(Character.toLowerCase(a[i]));
			else 
				System.out.print(a[i]);
			if(i==a.length-1)
				System.out.println();

		}
	}
}