import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String line =sc.nextLine();
		char[] ar = line.toCharArray();
		for(char ch:ar){
			if(ch>='A'&&ch<='Z'){
				System.out.printf("%c",ch+32);
			}else if(ch>='a'&&ch<='z'){
				System.out.printf("%c",ch-32);
			}else{
				System.out.print(ch);
			}
		}
		System.out.println();
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String line =sc.nextLine();
		char[] ar = line.toCharArray();
		for(char ch:ar){
			if(ch>='A'&&ch<='Z'){
				System.out.printf("%c",ch+32);
			}else if(ch>='a'&&ch<='z'){
				System.out.printf("%c",ch-32);
			}else{
				System.out.print(ch);
			}
		}
		System.out.println();
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String line =sc.nextLine();
		char[] ar = line.toCharArray();
		for(char ch:ar){
			if(ch>='A'&&ch<='Z'){
				System.out.printf("%c",ch+32);
			}else if(ch>='a'&&ch<='z'){
				System.out.printf("%c",ch-32);
			}else{
				System.out.print(ch);
			}
		}
		System.out.println();
	} main {
		Scanner sc = new Scanner(System.in);
		String line =sc.nextLine();
		char[] ar = line.toCharArray();
		for(char ch:ar){
			if(ch>='A'&&ch<='Z'){
				System.out.printf("%c",ch+32);
			}else if(ch>='a'&&ch<='z'){
				System.out.printf("%c",ch-32);
			}else{
				System.out.print(ch);
			}
		}
		System.out.println();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line =sc.nextLine(); line sc.nextLine() sc.nextLine sc char[] ar = line.toCharArray(); ar line.toCharArray() line.toCharArray line for(char ch:ar){
			if(ch>='A'&&ch<='Z'){
				System.out.printf("%c",ch+32);
			}else if(ch>='a'&&ch<='z'){
				System.out.printf("%c",ch-32);
			}else{
				System.out.print(ch);
			}
		} char ch ar {
			if(ch>='A'&&ch<='Z'){
				System.out.printf("%c",ch+32);
			}else if(ch>='a'&&ch<='z'){
				System.out.printf("%c",ch-32);
			}else{
				System.out.print(ch);
			}
		} {
			if(ch>='A'&&ch<='Z'){
				System.out.printf("%c",ch+32);
			}else if(ch>='a'&&ch<='z'){
				System.out.printf("%c",ch-32);
			}else{
				System.out.print(ch);
			}
		} if(ch>='A'&&ch<='Z'){
				System.out.printf("%c",ch+32);
			}else if(ch>='a'&&ch<='z'){
				System.out.printf("%c",ch-32);
			}else{
				System.out.print(ch);
			} ch>='A'&&ch<='Z' ch>='A' ch 'A' ch<='Z' ch 'Z' {
				System.out.printf("%c",ch+32);
			} System.out.printf("%c",ch+32) System.out.printf System.out System System.out "%c" ch+32 ch 32 if(ch>='a'&&ch<='z'){
				System.out.printf("%c",ch-32);
			}else{
				System.out.print(ch);
			} ch>='a'&&ch<='z' ch>='a' ch 'a' ch<='z' ch 'z' {
				System.out.printf("%c",ch-32);
			} System.out.printf("%c",ch-32) System.out.printf System.out System System.out "%c" ch-32 ch 32 {
				System.out.print(ch);
			} System.out.print(ch) System.out.print System.out System System.out ch 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 line =sc.nextLine();
		char[] ar = line.toCharArray();
		for(char ch:ar){
			if(ch>='A'&&ch<='Z'){
				System.out.printf("%c",ch+32);
			}else if(ch>='a'&&ch<='z'){
				System.out.printf("%c",ch-32);
			}else{
				System.out.print(ch);
			}
		}
		System.out.println();
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String line =sc.nextLine();
		char[] ar = line.toCharArray();
		for(char ch:ar){
			if(ch>='A'&&ch<='Z'){
				System.out.printf("%c",ch+32);
			}else if(ch>='a'&&ch<='z'){
				System.out.printf("%c",ch-32);
			}else{
				System.out.print(ch);
			}
		}
		System.out.println();
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String line =sc.nextLine();
		char[] ar = line.toCharArray();
		for(char ch:ar){
			if(ch>='A'&&ch<='Z'){
				System.out.printf("%c",ch+32);
			}else if(ch>='a'&&ch<='z'){
				System.out.printf("%c",ch-32);
			}else{
				System.out.print(ch);
			}
		}
		System.out.println();
	}
}