import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String before = sc.nextLine();
		String after = "";
		char[] c = before.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]);
			}
		}
		for (int i = 0; i < c.length; i++) {
			after += String.valueOf(c[i]);
		}
		System.out.println(after);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String before = sc.nextLine();
		String after = "";
		char[] c = before.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]);
			}
		}
		for (int i = 0; i < c.length; i++) {
			after += String.valueOf(c[i]);
		}
		System.out.println(after);
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String before = sc.nextLine();
		String after = "";
		char[] c = before.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]);
			}
		}
		for (int i = 0; i < c.length; i++) {
			after += String.valueOf(c[i]);
		}
		System.out.println(after);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		String before = sc.nextLine();
		String after = "";
		char[] c = before.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]);
			}
		}
		for (int i = 0; i < c.length; i++) {
			after += String.valueOf(c[i]);
		}
		System.out.println(after);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String before = sc.nextLine(); before sc.nextLine() sc.nextLine sc String after = ""; after "" char[] c = before.toCharArray(); c before.toCharArray() before.toCharArray before 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]);
			}
		} 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]);
			}
		} {
			if (Character.isUpperCase(c[i])) {
				c[i] = Character.toLowerCase(c[i]);
			} else if (Character.isLowerCase(c[i])) {
				c[i] = Character.toUpperCase(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]);
			} 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]);
			} 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 for (int i = 0; i < c.length; i++) {
			after += String.valueOf(c[i]);
		} int i = 0; int i = 0; i 0 i < c.length i c.length c c.length i++ i++ i {
			after += String.valueOf(c[i]);
		} {
			after += String.valueOf(c[i]);
		} after += String.valueOf(c[i]) after String.valueOf(c[i]) String.valueOf String c[i] c i System.out.println(after) System.out.println System.out System System.out after sc.close() sc.close sc String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String before = sc.nextLine();
		String after = "";
		char[] c = before.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]);
			}
		}
		for (int i = 0; i < c.length; i++) {
			after += String.valueOf(c[i]);
		}
		System.out.println(after);
		sc.close();
	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String before = sc.nextLine();
		String after = "";
		char[] c = before.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]);
			}
		}
		for (int i = 0; i < c.length; i++) {
			after += String.valueOf(c[i]);
		}
		System.out.println(after);
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String before = sc.nextLine();
		String after = "";
		char[] c = before.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]);
			}
		}
		for (int i = 0; i < c.length; i++) {
			after += String.valueOf(c[i]);
		}
		System.out.println(after);
		sc.close();
	}
}
