import java.util.Scanner;

public class Main{
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		String input = sc.nextLine();
		String work = "";
		for(int i = 0; i < input.length(); i++){
			work = input.substring(i,i+1);
			if(Character.isUpperCase(work.charAt(0))){
				System.out.print(work.toLowerCase());
			}else{
				System.out.print(work.toUpperCase());
			}
		}
		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 input = sc.nextLine();
		String work = "";
		for(int i = 0; i < input.length(); i++){
			work = input.substring(i,i+1);
			if(Character.isUpperCase(work.charAt(0))){
				System.out.print(work.toLowerCase());
			}else{
				System.out.print(work.toUpperCase());
			}
		}
		System.out.println("");
	}
} Main public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		String input = sc.nextLine();
		String work = "";
		for(int i = 0; i < input.length(); i++){
			work = input.substring(i,i+1);
			if(Character.isUpperCase(work.charAt(0))){
				System.out.print(work.toLowerCase());
			}else{
				System.out.print(work.toUpperCase());
			}
		}
		System.out.println("");
	} main {
		Scanner sc = new Scanner(System.in);
		String input = sc.nextLine();
		String work = "";
		for(int i = 0; i < input.length(); i++){
			work = input.substring(i,i+1);
			if(Character.isUpperCase(work.charAt(0))){
				System.out.print(work.toLowerCase());
			}else{
				System.out.print(work.toUpperCase());
			}
		}
		System.out.println("");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input = sc.nextLine(); input sc.nextLine() sc.nextLine sc String work = ""; work "" for(int i = 0; i < input.length(); i++){
			work = input.substring(i,i+1);
			if(Character.isUpperCase(work.charAt(0))){
				System.out.print(work.toLowerCase());
			}else{
				System.out.print(work.toUpperCase());
			}
		} int i = 0; int i = 0; i 0 i < input.length() i input.length() input.length input i++ i++ i {
			work = input.substring(i,i+1);
			if(Character.isUpperCase(work.charAt(0))){
				System.out.print(work.toLowerCase());
			}else{
				System.out.print(work.toUpperCase());
			}
		} {
			work = input.substring(i,i+1);
			if(Character.isUpperCase(work.charAt(0))){
				System.out.print(work.toLowerCase());
			}else{
				System.out.print(work.toUpperCase());
			}
		} work = input.substring(i,i+1) work input.substring(i,i+1) input.substring input i i+1 i 1 if(Character.isUpperCase(work.charAt(0))){
				System.out.print(work.toLowerCase());
			}else{
				System.out.print(work.toUpperCase());
			} Character.isUpperCase(work.charAt(0)) Character.isUpperCase Character work.charAt(0) work.charAt work 0 {
				System.out.print(work.toLowerCase());
			} System.out.print(work.toLowerCase()) System.out.print System.out System System.out work.toLowerCase() work.toLowerCase work {
				System.out.print(work.toUpperCase());
			} System.out.print(work.toUpperCase()) System.out.print System.out System System.out work.toUpperCase() work.toUpperCase work 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 input = sc.nextLine();
		String work = "";
		for(int i = 0; i < input.length(); i++){
			work = input.substring(i,i+1);
			if(Character.isUpperCase(work.charAt(0))){
				System.out.print(work.toLowerCase());
			}else{
				System.out.print(work.toUpperCase());
			}
		}
		System.out.println("");
	}
} public class Main{
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		String input = sc.nextLine();
		String work = "";
		for(int i = 0; i < input.length(); i++){
			work = input.substring(i,i+1);
			if(Character.isUpperCase(work.charAt(0))){
				System.out.print(work.toLowerCase());
			}else{
				System.out.print(work.toUpperCase());
			}
		}
		System.out.println("");
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		String input = sc.nextLine();
		String work = "";
		for(int i = 0; i < input.length(); i++){
			work = input.substring(i,i+1);
			if(Character.isUpperCase(work.charAt(0))){
				System.out.print(work.toLowerCase());
			}else{
				System.out.print(work.toUpperCase());
			}
		}
		System.out.println("");
	}
}