public class Main {
    public static void main (String[] args)  {

        // ??????????????????????????????.
        // ?????????????????????????????¨??????????????????.
        // ???????????????????????? char ???????????????????´???????.
        java.util.Scanner sc = new java.util.Scanner(System.in);
        String S = sc.nextLine();
        char[] C = S.toCharArray();
        char c = '?';

        // ??§??????????°??????????, ?°????????????§???????????????????????¨?????????.
        // ??¢????????????????????\????????????????????¨?????????.
        for (int i = 0; i < S.length(); i ++) {
            if (Character.isUpperCase(C[i])) { System.out.print(Character.toLowerCase(C[i])); }
            else if (Character.isLowerCase(C[i])) { System.out.print(Character.toUpperCase(C[i])); }
            else { System.out.print(C[i]); }
        }
        System.out.println();
    }
} public class Main {
    public static void main (String[] args)  {

        // ??????????????????????????????.
        // ?????????????????????????????¨??????????????????.
        // ???????????????????????? char ???????????????????´???????.
        java.util.Scanner sc = new java.util.Scanner(System.in);
        String S = sc.nextLine();
        char[] C = S.toCharArray();
        char c = '?';

        // ??§??????????°??????????, ?°????????????§???????????????????????¨?????????.
        // ??¢????????????????????\????????????????????¨?????????.
        for (int i = 0; i < S.length(); i ++) {
            if (Character.isUpperCase(C[i])) { System.out.print(Character.toLowerCase(C[i])); }
            else if (Character.isLowerCase(C[i])) { System.out.print(Character.toUpperCase(C[i])); }
            else { System.out.print(C[i]); }
        }
        System.out.println();
    }
} Main public static void main (String[] args)  {

        // ??????????????????????????????.
        // ?????????????????????????????¨??????????????????.
        // ???????????????????????? char ???????????????????´???????.
        java.util.Scanner sc = new java.util.Scanner(System.in);
        String S = sc.nextLine();
        char[] C = S.toCharArray();
        char c = '?';

        // ??§??????????°??????????, ?°????????????§???????????????????????¨?????????.
        // ??¢????????????????????\????????????????????¨?????????.
        for (int i = 0; i < S.length(); i ++) {
            if (Character.isUpperCase(C[i])) { System.out.print(Character.toLowerCase(C[i])); }
            else if (Character.isLowerCase(C[i])) { System.out.print(Character.toUpperCase(C[i])); }
            else { System.out.print(C[i]); }
        }
        System.out.println();
    } main {

        // ??????????????????????????????.
        // ?????????????????????????????¨??????????????????.
        // ???????????????????????? char ???????????????????´???????.
        java.util.Scanner sc = new java.util.Scanner(System.in);
        String S = sc.nextLine();
        char[] C = S.toCharArray();
        char c = '?';

        // ??§??????????°??????????, ?°????????????§???????????????????????¨?????????.
        // ??¢????????????????????\????????????????????¨?????????.
        for (int i = 0; i < S.length(); i ++) {
            if (Character.isUpperCase(C[i])) { System.out.print(Character.toLowerCase(C[i])); }
            else if (Character.isLowerCase(C[i])) { System.out.print(Character.toUpperCase(C[i])); }
            else { System.out.print(C[i]); }
        }
        System.out.println();
    } java.util.Scanner sc = new java.util.Scanner(System.in); sc new java.util.Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc char[] C = S.toCharArray(); C S.toCharArray() S.toCharArray S char c = '?'; c '?' for (int i = 0; i < S.length(); i ++) {
            if (Character.isUpperCase(C[i])) { System.out.print(Character.toLowerCase(C[i])); }
            else if (Character.isLowerCase(C[i])) { System.out.print(Character.toUpperCase(C[i])); }
            else { System.out.print(C[i]); }
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i ++ i ++ i {
            if (Character.isUpperCase(C[i])) { System.out.print(Character.toLowerCase(C[i])); }
            else if (Character.isLowerCase(C[i])) { System.out.print(Character.toUpperCase(C[i])); }
            else { System.out.print(C[i]); }
        } {
            if (Character.isUpperCase(C[i])) { System.out.print(Character.toLowerCase(C[i])); }
            else if (Character.isLowerCase(C[i])) { System.out.print(Character.toUpperCase(C[i])); }
            else { System.out.print(C[i]); }
        } if (Character.isUpperCase(C[i])) { System.out.print(Character.toLowerCase(C[i])); }
            else if (Character.isLowerCase(C[i])) { System.out.print(Character.toUpperCase(C[i])); }
            else { System.out.print(C[i]); } Character.isUpperCase(C[i]) Character.isUpperCase Character C[i] C i { System.out.print(Character.toLowerCase(C[i])); } System.out.print(Character.toLowerCase(C[i])) System.out.print System.out System System.out Character.toLowerCase(C[i]) Character.toLowerCase Character C[i] C i if (Character.isLowerCase(C[i])) { System.out.print(Character.toUpperCase(C[i])); }
            else { System.out.print(C[i]); } Character.isLowerCase(C[i]) Character.isLowerCase Character C[i] C i { System.out.print(Character.toUpperCase(C[i])); } System.out.print(Character.toUpperCase(C[i])) System.out.print System.out System System.out Character.toUpperCase(C[i]) Character.toUpperCase Character C[i] C i { System.out.print(C[i]); } System.out.print(C[i]) System.out.print System.out System System.out C[i] C i System.out.println() System.out.println System.out System System.out String[] args args public class Main {
    public static void main (String[] args)  {

        // ??????????????????????????????.
        // ?????????????????????????????¨??????????????????.
        // ???????????????????????? char ???????????????????´???????.
        java.util.Scanner sc = new java.util.Scanner(System.in);
        String S = sc.nextLine();
        char[] C = S.toCharArray();
        char c = '?';

        // ??§??????????°??????????, ?°????????????§???????????????????????¨?????????.
        // ??¢????????????????????\????????????????????¨?????????.
        for (int i = 0; i < S.length(); i ++) {
            if (Character.isUpperCase(C[i])) { System.out.print(Character.toLowerCase(C[i])); }
            else if (Character.isLowerCase(C[i])) { System.out.print(Character.toUpperCase(C[i])); }
            else { System.out.print(C[i]); }
        }
        System.out.println();
    }
} public class Main {
    public static void main (String[] args)  {

        // ??????????????????????????????.
        // ?????????????????????????????¨??????????????????.
        // ???????????????????????? char ???????????????????´???????.
        java.util.Scanner sc = new java.util.Scanner(System.in);
        String S = sc.nextLine();
        char[] C = S.toCharArray();
        char c = '?';

        // ??§??????????°??????????, ?°????????????§???????????????????????¨?????????.
        // ??¢????????????????????\????????????????????¨?????????.
        for (int i = 0; i < S.length(); i ++) {
            if (Character.isUpperCase(C[i])) { System.out.print(Character.toLowerCase(C[i])); }
            else if (Character.isLowerCase(C[i])) { System.out.print(Character.toUpperCase(C[i])); }
            else { System.out.print(C[i]); }
        }
        System.out.println();
    }
} Main
public class Main {
    public static void main (String[] args)  {

        // ??????????????????????????????.
        // ?????????????????????????????¨??????????????????.
        // ???????????????????????? char ???????????????????´???????.
        java.util.Scanner sc = new java.util.Scanner(System.in);
        String S = sc.nextLine();
        char[] C = S.toCharArray();
        char c = '?';

        // ??§??????????°??????????, ?°????????????§???????????????????????¨?????????.
        // ??¢????????????????????\????????????????????¨?????????.
        for (int i = 0; i < S.length(); i ++) {
            if (Character.isUpperCase(C[i])) { System.out.print(Character.toLowerCase(C[i])); }
            else if (Character.isLowerCase(C[i])) { System.out.print(Character.toUpperCase(C[i])); }
            else { System.out.print(C[i]); }
        }
        System.out.println();
    }
}