import java.util.Scanner;
import java.util.Arrays;

class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String s = scanner.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]);
			}else{
				c[i] = c[i];
			}
		}

		System.out.println(c);
		
	}
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String s = scanner.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]);
			}else{
				c[i] = c[i];
			}
		}

		System.out.println(c);
		
	}
} Main public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String s = scanner.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]);
			}else{
				c[i] = c[i];
			}
		}

		System.out.println(c);
		
	} main {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.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]);
			}else{
				c[i] = c[i];
			}
		}

		System.out.println(c);
		
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s = scanner.nextLine(); s scanner.nextLine() scanner.nextLine scanner 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]);
			}else{
				c[i] = 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]);
			}else{
				c[i] = 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]);
			}else{
				c[i] = 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]);
			}else{
				c[i] = c[i];
			} Character.isUpperCase(c[i]) Character.isUpperCase Character c[i] c i {
				c[i] = Character.toLowerCase(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]);
			}else{
				c[i] = c[i];
			} Character.isLowerCase(c[i]) Character.isLowerCase Character c[i] c i {
				c[i] = Character.toUpperCase(c[i]);
			} c[i] = Character.toUpperCase(c[i]) c[i] c i Character.toUpperCase(c[i]) Character.toUpperCase Character c[i] c i {
				c[i] = c[i];
			} c[i] = c[i] c[i] c i c[i] c i System.out.println(c) System.out.println System.out System System.out c String[] args args
import java.util.Scanner;
import java.util.Arrays;

class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String s = scanner.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]);
			}else{
				c[i] = c[i];
			}
		}

		System.out.println(c);
		
	}
}