import java.util.*;

class Main {
        public static void main(String args[]) {
                try (Scanner sc = new Scanner(System.in)) {
                        String S = sc.nextLine();
                        for (int i = 0; i < S.length(); i++) {
                                if (Character.isUpperCase(S.charAt(i))) {
                                        System.out.print(Character.toLowerCase(S.charAt(i)));
                                } else {
                                        System.out.print(Character.toUpperCase(S.charAt(i)));
                                }
                        }
                        System.out.println("");
                }
        }
} import java.util.*; util.* java class Main {
        public static void main(String args[]) {
                try (Scanner sc = new Scanner(System.in)) {
                        String S = sc.nextLine();
                        for (int i = 0; i < S.length(); i++) {
                                if (Character.isUpperCase(S.charAt(i))) {
                                        System.out.print(Character.toLowerCase(S.charAt(i)));
                                } else {
                                        System.out.print(Character.toUpperCase(S.charAt(i)));
                                }
                        }
                        System.out.println("");
                }
        }
} Main public static void main(String args[]) {
                try (Scanner sc = new Scanner(System.in)) {
                        String S = sc.nextLine();
                        for (int i = 0; i < S.length(); i++) {
                                if (Character.isUpperCase(S.charAt(i))) {
                                        System.out.print(Character.toLowerCase(S.charAt(i)));
                                } else {
                                        System.out.print(Character.toUpperCase(S.charAt(i)));
                                }
                        }
                        System.out.println("");
                }
        } main {
                try (Scanner sc = new Scanner(System.in)) {
                        String S = sc.nextLine();
                        for (int i = 0; i < S.length(); i++) {
                                if (Character.isUpperCase(S.charAt(i))) {
                                        System.out.print(Character.toLowerCase(S.charAt(i)));
                                } else {
                                        System.out.print(Character.toUpperCase(S.charAt(i)));
                                }
                        }
                        System.out.println("");
                }
        } try (Scanner sc = new Scanner(System.in)) {
                        String S = sc.nextLine();
                        for (int i = 0; i < S.length(); i++) {
                                if (Character.isUpperCase(S.charAt(i))) {
                                        System.out.print(Character.toLowerCase(S.charAt(i)));
                                } else {
                                        System.out.print(Character.toUpperCase(S.charAt(i)));
                                }
                        }
                        System.out.println("");
                } {
                        String S = sc.nextLine();
                        for (int i = 0; i < S.length(); i++) {
                                if (Character.isUpperCase(S.charAt(i))) {
                                        System.out.print(Character.toLowerCase(S.charAt(i)));
                                } else {
                                        System.out.print(Character.toUpperCase(S.charAt(i)));
                                }
                        }
                        System.out.println("");
                } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc for (int i = 0; i < S.length(); i++) {
                                if (Character.isUpperCase(S.charAt(i))) {
                                        System.out.print(Character.toLowerCase(S.charAt(i)));
                                } else {
                                        System.out.print(Character.toUpperCase(S.charAt(i)));
                                }
                        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
                                if (Character.isUpperCase(S.charAt(i))) {
                                        System.out.print(Character.toLowerCase(S.charAt(i)));
                                } else {
                                        System.out.print(Character.toUpperCase(S.charAt(i)));
                                }
                        } {
                                if (Character.isUpperCase(S.charAt(i))) {
                                        System.out.print(Character.toLowerCase(S.charAt(i)));
                                } else {
                                        System.out.print(Character.toUpperCase(S.charAt(i)));
                                }
                        } if (Character.isUpperCase(S.charAt(i))) {
                                        System.out.print(Character.toLowerCase(S.charAt(i)));
                                } else {
                                        System.out.print(Character.toUpperCase(S.charAt(i)));
                                } Character.isUpperCase(S.charAt(i)) Character.isUpperCase Character S.charAt(i) S.charAt S i {
                                        System.out.print(Character.toLowerCase(S.charAt(i)));
                                } System.out.print(Character.toLowerCase(S.charAt(i))) System.out.print System.out System System.out Character.toLowerCase(S.charAt(i)) Character.toLowerCase Character S.charAt(i) S.charAt S i {
                                        System.out.print(Character.toUpperCase(S.charAt(i)));
                                } System.out.print(Character.toUpperCase(S.charAt(i))) System.out.print System.out System System.out Character.toUpperCase(S.charAt(i)) Character.toUpperCase Character S.charAt(i) S.charAt S i System.out.println("") System.out.println System.out System System.out "" String args[] args
import java.util.*;

class Main {
        public static void main(String args[]) {
                try (Scanner sc = new Scanner(System.in)) {
                        String S = sc.nextLine();
                        for (int i = 0; i < S.length(); i++) {
                                if (Character.isUpperCase(S.charAt(i))) {
                                        System.out.print(Character.toLowerCase(S.charAt(i)));
                                } else {
                                        System.out.print(Character.toUpperCase(S.charAt(i)));
                                }
                        }
                        System.out.println("");
                }
        }
}