import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		scan.useDelimiter("?\?\r?\?\n");
		// ??\???
		String s = scan.next();
		// ??????????????????
		int s1 = s.length();
		
		String S = "";
		for(int i=0; i<s1; i++){
			String s2 = s.substring(i, i+1);
			String s3;
			if( s2.matches( "[a-z]+" ) ){
				String upper_s2 = s2.toUpperCase();
				S = S + upper_s2;
			}
			/*
			else if (s2 == a){
				
				S = S + s3;
			}
			*/
			else {
				String lower_s2 = s2.toLowerCase();
				S = S + lower_s2;
			}
		}
		
		System.out.print(S);

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		scan.useDelimiter("?\?\r?\?\n");
		// ??\???
		String s = scan.next();
		// ??????????????????
		int s1 = s.length();
		
		String S = "";
		for(int i=0; i<s1; i++){
			String s2 = s.substring(i, i+1);
			String s3;
			if( s2.matches( "[a-z]+" ) ){
				String upper_s2 = s2.toUpperCase();
				S = S + upper_s2;
			}
			/*
			else if (s2 == a){
				
				S = S + s3;
			}
			*/
			else {
				String lower_s2 = s2.toLowerCase();
				S = S + lower_s2;
			}
		}
		
		System.out.print(S);

	}

} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		scan.useDelimiter("?\?\r?\?\n");
		// ??\???
		String s = scan.next();
		// ??????????????????
		int s1 = s.length();
		
		String S = "";
		for(int i=0; i<s1; i++){
			String s2 = s.substring(i, i+1);
			String s3;
			if( s2.matches( "[a-z]+" ) ){
				String upper_s2 = s2.toUpperCase();
				S = S + upper_s2;
			}
			/*
			else if (s2 == a){
				
				S = S + s3;
			}
			*/
			else {
				String lower_s2 = s2.toLowerCase();
				S = S + lower_s2;
			}
		}
		
		System.out.print(S);

	} main {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		scan.useDelimiter("?\?\r?\?\n");
		// ??\???
		String s = scan.next();
		// ??????????????????
		int s1 = s.length();
		
		String S = "";
		for(int i=0; i<s1; i++){
			String s2 = s.substring(i, i+1);
			String s3;
			if( s2.matches( "[a-z]+" ) ){
				String upper_s2 = s2.toUpperCase();
				S = S + upper_s2;
			}
			/*
			else if (s2 == a){
				
				S = S + s3;
			}
			*/
			else {
				String lower_s2 = s2.toLowerCase();
				S = S + lower_s2;
			}
		}
		
		System.out.print(S);

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) scan.useDelimiter("?\?\r?\?\n") scan.useDelimiter scan "?\?\r?\?\n" String s = scan.next(); s scan.next() scan.next scan int s1 = s.length(); s1 s.length() s.length s String S = ""; S "" for(int i=0; i<s1; i++){
			String s2 = s.substring(i, i+1);
			String s3;
			if( s2.matches( "[a-z]+" ) ){
				String upper_s2 = s2.toUpperCase();
				S = S + upper_s2;
			}
			/*
			else if (s2 == a){
				
				S = S + s3;
			}
			*/
			else {
				String lower_s2 = s2.toLowerCase();
				S = S + lower_s2;
			}
		} int i=0; int i=0; i 0 i<s1 i s1 i++ i++ i {
			String s2 = s.substring(i, i+1);
			String s3;
			if( s2.matches( "[a-z]+" ) ){
				String upper_s2 = s2.toUpperCase();
				S = S + upper_s2;
			}
			/*
			else if (s2 == a){
				
				S = S + s3;
			}
			*/
			else {
				String lower_s2 = s2.toLowerCase();
				S = S + lower_s2;
			}
		} {
			String s2 = s.substring(i, i+1);
			String s3;
			if( s2.matches( "[a-z]+" ) ){
				String upper_s2 = s2.toUpperCase();
				S = S + upper_s2;
			}
			/*
			else if (s2 == a){
				
				S = S + s3;
			}
			*/
			else {
				String lower_s2 = s2.toLowerCase();
				S = S + lower_s2;
			}
		} String s2 = s.substring(i, i+1); s2 s.substring(i, i+1) s.substring s i i+1 i 1 String s3; s3 if( s2.matches( "[a-z]+" ) ){
				String upper_s2 = s2.toUpperCase();
				S = S + upper_s2;
			}
			/*
			else if (s2 == a){
				
				S = S + s3;
			}
			*/
			else {
				String lower_s2 = s2.toLowerCase();
				S = S + lower_s2;
			} s2.matches( "[a-z]+" ) s2.matches s2 "[a-z]+" {
				String upper_s2 = s2.toUpperCase();
				S = S + upper_s2;
			} String upper_s2 = s2.toUpperCase(); upper_s2 s2.toUpperCase() s2.toUpperCase s2 S = S + upper_s2 S S + upper_s2 S upper_s2 {
				String lower_s2 = s2.toLowerCase();
				S = S + lower_s2;
			} String lower_s2 = s2.toLowerCase(); lower_s2 s2.toLowerCase() s2.toLowerCase s2 S = S + lower_s2 S S + lower_s2 S lower_s2 System.out.print(S) System.out.print System.out System System.out S String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		scan.useDelimiter("?\?\r?\?\n");
		// ??\???
		String s = scan.next();
		// ??????????????????
		int s1 = s.length();
		
		String S = "";
		for(int i=0; i<s1; i++){
			String s2 = s.substring(i, i+1);
			String s3;
			if( s2.matches( "[a-z]+" ) ){
				String upper_s2 = s2.toUpperCase();
				S = S + upper_s2;
			}
			/*
			else if (s2 == a){
				
				S = S + s3;
			}
			*/
			else {
				String lower_s2 = s2.toLowerCase();
				S = S + lower_s2;
			}
		}
		
		System.out.print(S);

	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		scan.useDelimiter("?\?\r?\?\n");
		// ??\???
		String s = scan.next();
		// ??????????????????
		int s1 = s.length();
		
		String S = "";
		for(int i=0; i<s1; i++){
			String s2 = s.substring(i, i+1);
			String s3;
			if( s2.matches( "[a-z]+" ) ){
				String upper_s2 = s2.toUpperCase();
				S = S + upper_s2;
			}
			/*
			else if (s2 == a){
				
				S = S + s3;
			}
			*/
			else {
				String lower_s2 = s2.toLowerCase();
				S = S + lower_s2;
			}
		}
		
		System.out.print(S);

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		scan.useDelimiter("?\?\r?\?\n");
		// ??\???
		String s = scan.next();
		// ??????????????????
		int s1 = s.length();
		
		String S = "";
		for(int i=0; i<s1; i++){
			String s2 = s.substring(i, i+1);
			String s3;
			if( s2.matches( "[a-z]+" ) ){
				String upper_s2 = s2.toUpperCase();
				S = S + upper_s2;
			}
			/*
			else if (s2 == a){
				
				S = S + s3;
			}
			*/
			else {
				String lower_s2 = s2.toLowerCase();
				S = S + lower_s2;
			}
		}
		
		System.out.print(S);

	}

}