import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String ans = "";
		for (int i = 0; i < line.length(); i++) {
			char c = line.charAt(i);
			if (Character.isLowerCase(c)) {
				ans += Character.toUpperCase(c);
			} else {
				ans += Character.toLowerCase(c);
			}
		}
		System.out.println(ans);
		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 line = sc.nextLine();
		String ans = "";
		for (int i = 0; i < line.length(); i++) {
			char c = line.charAt(i);
			if (Character.isLowerCase(c)) {
				ans += Character.toUpperCase(c);
			} else {
				ans += Character.toLowerCase(c);
			}
		}
		System.out.println(ans);
		sc.close();
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String ans = "";
		for (int i = 0; i < line.length(); i++) {
			char c = line.charAt(i);
			if (Character.isLowerCase(c)) {
				ans += Character.toUpperCase(c);
			} else {
				ans += Character.toLowerCase(c);
			}
		}
		System.out.println(ans);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String ans = "";
		for (int i = 0; i < line.length(); i++) {
			char c = line.charAt(i);
			if (Character.isLowerCase(c)) {
				ans += Character.toUpperCase(c);
			} else {
				ans += Character.toLowerCase(c);
			}
		}
		System.out.println(ans);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc String ans = ""; ans "" for (int i = 0; i < line.length(); i++) {
			char c = line.charAt(i);
			if (Character.isLowerCase(c)) {
				ans += Character.toUpperCase(c);
			} else {
				ans += Character.toLowerCase(c);
			}
		} int i = 0; int i = 0; i 0 i < line.length() i line.length() line.length line i++ i++ i {
			char c = line.charAt(i);
			if (Character.isLowerCase(c)) {
				ans += Character.toUpperCase(c);
			} else {
				ans += Character.toLowerCase(c);
			}
		} {
			char c = line.charAt(i);
			if (Character.isLowerCase(c)) {
				ans += Character.toUpperCase(c);
			} else {
				ans += Character.toLowerCase(c);
			}
		} char c = line.charAt(i); c line.charAt(i) line.charAt line i if (Character.isLowerCase(c)) {
				ans += Character.toUpperCase(c);
			} else {
				ans += Character.toLowerCase(c);
			} Character.isLowerCase(c) Character.isLowerCase Character c {
				ans += Character.toUpperCase(c);
			} ans += Character.toUpperCase(c) ans Character.toUpperCase(c) Character.toUpperCase Character c {
				ans += Character.toLowerCase(c);
			} ans += Character.toLowerCase(c) ans Character.toLowerCase(c) Character.toLowerCase Character c System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String ans = "";
		for (int i = 0; i < line.length(); i++) {
			char c = line.charAt(i);
			if (Character.isLowerCase(c)) {
				ans += Character.toUpperCase(c);
			} else {
				ans += Character.toLowerCase(c);
			}
		}
		System.out.println(ans);
		sc.close();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String ans = "";
		for (int i = 0; i < line.length(); i++) {
			char c = line.charAt(i);
			if (Character.isLowerCase(c)) {
				ans += Character.toUpperCase(c);
			} else {
				ans += Character.toLowerCase(c);
			}
		}
		System.out.println(ans);
		sc.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String ans = "";
		for (int i = 0; i < line.length(); i++) {
			char c = line.charAt(i);
			if (Character.isLowerCase(c)) {
				ans += Character.toUpperCase(c);
			} else {
				ans += Character.toLowerCase(c);
			}
		}
		System.out.println(ans);
		sc.close();
	}

}
