import java.io.ByteArrayInputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    String INPUT = "";

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    void run() {
        Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
        PrintWriter out = new PrintWriter(System.out);

        solve(sc, out);
        out.flush();
    }

    void solve(Scanner sc, PrintWriter out) {
        String S = sc.nextLine();
        String ans = "";
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) >= 'a' && S.charAt(i) <= 'z') {
                ans += S.substring(i, i+1).toUpperCase();
            } else if (S.charAt(i) >= 'A' && S.charAt(i) <= 'Z'){
                ans += S.substring(i, i+1).toLowerCase();
            } else {
                ans += S.substring(i, i+1);
            }
        }
        System.out.println(ans);
    }
}
 import java.io.ByteArrayInputStream; ByteArrayInputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {

    String INPUT = "";

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    void run() {
        Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
        PrintWriter out = new PrintWriter(System.out);

        solve(sc, out);
        out.flush();
    }

    void solve(Scanner sc, PrintWriter out) {
        String S = sc.nextLine();
        String ans = "";
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) >= 'a' && S.charAt(i) <= 'z') {
                ans += S.substring(i, i+1).toUpperCase();
            } else if (S.charAt(i) >= 'A' && S.charAt(i) <= 'Z'){
                ans += S.substring(i, i+1).toLowerCase();
            } else {
                ans += S.substring(i, i+1);
            }
        }
        System.out.println(ans);
    }
} Main String INPUT = ""; INPUT "" public static void main(String[] args) throws Exception {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args void run() {
        Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
        PrintWriter out = new PrintWriter(System.out);

        solve(sc, out);
        out.flush();
    } run {
        Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
        PrintWriter out = new PrintWriter(System.out);

        solve(sc, out);
        out.flush();
    } Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes())); sc INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes())) INPUT.isEmpty() INPUT.isEmpty INPUT new Scanner(System.in) new Scanner(new ByteArrayInputStream(INPUT.getBytes())) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) solve(sc, out) solve sc out out.flush() out.flush out void solve(Scanner sc, PrintWriter out) {
        String S = sc.nextLine();
        String ans = "";
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) >= 'a' && S.charAt(i) <= 'z') {
                ans += S.substring(i, i+1).toUpperCase();
            } else if (S.charAt(i) >= 'A' && S.charAt(i) <= 'Z'){
                ans += S.substring(i, i+1).toLowerCase();
            } else {
                ans += S.substring(i, i+1);
            }
        }
        System.out.println(ans);
    } solve {
        String S = sc.nextLine();
        String ans = "";
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) >= 'a' && S.charAt(i) <= 'z') {
                ans += S.substring(i, i+1).toUpperCase();
            } else if (S.charAt(i) >= 'A' && S.charAt(i) <= 'Z'){
                ans += S.substring(i, i+1).toLowerCase();
            } else {
                ans += S.substring(i, i+1);
            }
        }
        System.out.println(ans);
    } String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc String ans = ""; ans "" for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) >= 'a' && S.charAt(i) <= 'z') {
                ans += S.substring(i, i+1).toUpperCase();
            } else if (S.charAt(i) >= 'A' && S.charAt(i) <= 'Z'){
                ans += S.substring(i, i+1).toLowerCase();
            } else {
                ans += S.substring(i, i+1);
            }
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            if (S.charAt(i) >= 'a' && S.charAt(i) <= 'z') {
                ans += S.substring(i, i+1).toUpperCase();
            } else if (S.charAt(i) >= 'A' && S.charAt(i) <= 'Z'){
                ans += S.substring(i, i+1).toLowerCase();
            } else {
                ans += S.substring(i, i+1);
            }
        } {
            if (S.charAt(i) >= 'a' && S.charAt(i) <= 'z') {
                ans += S.substring(i, i+1).toUpperCase();
            } else if (S.charAt(i) >= 'A' && S.charAt(i) <= 'Z'){
                ans += S.substring(i, i+1).toLowerCase();
            } else {
                ans += S.substring(i, i+1);
            }
        } if (S.charAt(i) >= 'a' && S.charAt(i) <= 'z') {
                ans += S.substring(i, i+1).toUpperCase();
            } else if (S.charAt(i) >= 'A' && S.charAt(i) <= 'Z'){
                ans += S.substring(i, i+1).toLowerCase();
            } else {
                ans += S.substring(i, i+1);
            } S.charAt(i) >= 'a' && S.charAt(i) <= 'z' S.charAt(i) >= 'a' S.charAt(i) S.charAt S i 'a' S.charAt(i) <= 'z' S.charAt(i) S.charAt S i 'z' {
                ans += S.substring(i, i+1).toUpperCase();
            } ans += S.substring(i, i+1).toUpperCase() ans S.substring(i, i+1).toUpperCase() S.substring(i, i+1).toUpperCase S.substring(i, i+1) S.substring S i i+1 i 1 if (S.charAt(i) >= 'A' && S.charAt(i) <= 'Z'){
                ans += S.substring(i, i+1).toLowerCase();
            } else {
                ans += S.substring(i, i+1);
            } S.charAt(i) >= 'A' && S.charAt(i) <= 'Z' S.charAt(i) >= 'A' S.charAt(i) S.charAt S i 'A' S.charAt(i) <= 'Z' S.charAt(i) S.charAt S i 'Z' {
                ans += S.substring(i, i+1).toLowerCase();
            } ans += S.substring(i, i+1).toLowerCase() ans S.substring(i, i+1).toLowerCase() S.substring(i, i+1).toLowerCase S.substring(i, i+1) S.substring S i i+1 i 1 {
                ans += S.substring(i, i+1);
            } ans += S.substring(i, i+1) ans S.substring(i, i+1) S.substring S i i+1 i 1 System.out.println(ans) System.out.println System.out System System.out ans Scanner sc sc PrintWriter out out public class Main {

    String INPUT = "";

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    void run() {
        Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
        PrintWriter out = new PrintWriter(System.out);

        solve(sc, out);
        out.flush();
    }

    void solve(Scanner sc, PrintWriter out) {
        String S = sc.nextLine();
        String ans = "";
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) >= 'a' && S.charAt(i) <= 'z') {
                ans += S.substring(i, i+1).toUpperCase();
            } else if (S.charAt(i) >= 'A' && S.charAt(i) <= 'Z'){
                ans += S.substring(i, i+1).toLowerCase();
            } else {
                ans += S.substring(i, i+1);
            }
        }
        System.out.println(ans);
    }
} public class Main {

    String INPUT = "";

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    void run() {
        Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
        PrintWriter out = new PrintWriter(System.out);

        solve(sc, out);
        out.flush();
    }

    void solve(Scanner sc, PrintWriter out) {
        String S = sc.nextLine();
        String ans = "";
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) >= 'a' && S.charAt(i) <= 'z') {
                ans += S.substring(i, i+1).toUpperCase();
            } else if (S.charAt(i) >= 'A' && S.charAt(i) <= 'Z'){
                ans += S.substring(i, i+1).toLowerCase();
            } else {
                ans += S.substring(i, i+1);
            }
        }
        System.out.println(ans);
    }
} Main
import java.io.ByteArrayInputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    String INPUT = "";

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    void run() {
        Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
        PrintWriter out = new PrintWriter(System.out);

        solve(sc, out);
        out.flush();
    }

    void solve(Scanner sc, PrintWriter out) {
        String S = sc.nextLine();
        String ans = "";
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) >= 'a' && S.charAt(i) <= 'z') {
                ans += S.substring(i, i+1).toUpperCase();
            } else if (S.charAt(i) >= 'A' && S.charAt(i) <= 'Z'){
                ans += S.substring(i, i+1).toLowerCase();
            } else {
                ans += S.substring(i, i+1);
            }
        }
        System.out.println(ans);
    }
}

