import java.io.*;
public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		StringBuilder sb = new StringBuilder();
		for(char c : str.toCharArray()){
			if(Character.isUpperCase(c)){
				String s = String.valueOf(c);
				sb.append(s.toLowerCase());
			}else{
				String s = String.valueOf(c);
				sb.append(s.toUpperCase());
			}
		}
		System.out.println(sb.toString());
	}
} import java.io.*; io.* java public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		StringBuilder sb = new StringBuilder();
		for(char c : str.toCharArray()){
			if(Character.isUpperCase(c)){
				String s = String.valueOf(c);
				sb.append(s.toLowerCase());
			}else{
				String s = String.valueOf(c);
				sb.append(s.toUpperCase());
			}
		}
		System.out.println(sb.toString());
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		StringBuilder sb = new StringBuilder();
		for(char c : str.toCharArray()){
			if(Character.isUpperCase(c)){
				String s = String.valueOf(c);
				sb.append(s.toLowerCase());
			}else{
				String s = String.valueOf(c);
				sb.append(s.toUpperCase());
			}
		}
		System.out.println(sb.toString());
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		StringBuilder sb = new StringBuilder();
		for(char c : str.toCharArray()){
			if(Character.isUpperCase(c)){
				String s = String.valueOf(c);
				sb.append(s.toLowerCase());
			}else{
				String s = String.valueOf(c);
				sb.append(s.toUpperCase());
			}
		}
		System.out.println(sb.toString());
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str = br.readLine(); str br.readLine() br.readLine br StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(char c : str.toCharArray()){
			if(Character.isUpperCase(c)){
				String s = String.valueOf(c);
				sb.append(s.toLowerCase());
			}else{
				String s = String.valueOf(c);
				sb.append(s.toUpperCase());
			}
		} char c str.toCharArray() str.toCharArray str {
			if(Character.isUpperCase(c)){
				String s = String.valueOf(c);
				sb.append(s.toLowerCase());
			}else{
				String s = String.valueOf(c);
				sb.append(s.toUpperCase());
			}
		} {
			if(Character.isUpperCase(c)){
				String s = String.valueOf(c);
				sb.append(s.toLowerCase());
			}else{
				String s = String.valueOf(c);
				sb.append(s.toUpperCase());
			}
		} if(Character.isUpperCase(c)){
				String s = String.valueOf(c);
				sb.append(s.toLowerCase());
			}else{
				String s = String.valueOf(c);
				sb.append(s.toUpperCase());
			} Character.isUpperCase(c) Character.isUpperCase Character c {
				String s = String.valueOf(c);
				sb.append(s.toLowerCase());
			} String s = String.valueOf(c); s String.valueOf(c) String.valueOf String c sb.append(s.toLowerCase()) sb.append sb s.toLowerCase() s.toLowerCase s {
				String s = String.valueOf(c);
				sb.append(s.toUpperCase());
			} String s = String.valueOf(c); s String.valueOf(c) String.valueOf String c sb.append(s.toUpperCase()) sb.append sb s.toUpperCase() s.toUpperCase s System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		StringBuilder sb = new StringBuilder();
		for(char c : str.toCharArray()){
			if(Character.isUpperCase(c)){
				String s = String.valueOf(c);
				sb.append(s.toLowerCase());
			}else{
				String s = String.valueOf(c);
				sb.append(s.toUpperCase());
			}
		}
		System.out.println(sb.toString());
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		StringBuilder sb = new StringBuilder();
		for(char c : str.toCharArray()){
			if(Character.isUpperCase(c)){
				String s = String.valueOf(c);
				sb.append(s.toLowerCase());
			}else{
				String s = String.valueOf(c);
				sb.append(s.toUpperCase());
			}
		}
		System.out.println(sb.toString());
	}
} Main
import java.io.*;
public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		StringBuilder sb = new StringBuilder();
		for(char c : str.toCharArray()){
			if(Character.isUpperCase(c)){
				String s = String.valueOf(c);
				sb.append(s.toLowerCase());
			}else{
				String s = String.valueOf(c);
				sb.append(s.toUpperCase());
			}
		}
		System.out.println(sb.toString());
	}
}