import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int lsn = 65;
        int ssn = 97;

        char large[] = new char[26];
        char small[] = new char[26];
        char sign[] = {' ', ',', '.'};

        for (int i = 0; i < 26; i++) {
            large[i] = (char) lsn++;
            small[i] = (char) ssn++;
        }

        String str = sc.nextLine();
        StringBuilder ans = new StringBuilder();

        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            if (s.matches("[A-Z]")) {
                ans.append(s.toLowerCase());
            } else if (s.matches("[a-z]")) {
                ans.append(s.toUpperCase());
            } else {
                ans.append(str.charAt(i));
            }
        }
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int lsn = 65;
        int ssn = 97;

        char large[] = new char[26];
        char small[] = new char[26];
        char sign[] = {' ', ',', '.'};

        for (int i = 0; i < 26; i++) {
            large[i] = (char) lsn++;
            small[i] = (char) ssn++;
        }

        String str = sc.nextLine();
        StringBuilder ans = new StringBuilder();

        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            if (s.matches("[A-Z]")) {
                ans.append(s.toLowerCase());
            } else if (s.matches("[a-z]")) {
                ans.append(s.toUpperCase());
            } else {
                ans.append(str.charAt(i));
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int lsn = 65;
        int ssn = 97;

        char large[] = new char[26];
        char small[] = new char[26];
        char sign[] = {' ', ',', '.'};

        for (int i = 0; i < 26; i++) {
            large[i] = (char) lsn++;
            small[i] = (char) ssn++;
        }

        String str = sc.nextLine();
        StringBuilder ans = new StringBuilder();

        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            if (s.matches("[A-Z]")) {
                ans.append(s.toLowerCase());
            } else if (s.matches("[a-z]")) {
                ans.append(s.toUpperCase());
            } else {
                ans.append(str.charAt(i));
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);

        int lsn = 65;
        int ssn = 97;

        char large[] = new char[26];
        char small[] = new char[26];
        char sign[] = {' ', ',', '.'};

        for (int i = 0; i < 26; i++) {
            large[i] = (char) lsn++;
            small[i] = (char) ssn++;
        }

        String str = sc.nextLine();
        StringBuilder ans = new StringBuilder();

        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            if (s.matches("[A-Z]")) {
                ans.append(s.toLowerCase());
            } else if (s.matches("[a-z]")) {
                ans.append(s.toUpperCase());
            } else {
                ans.append(str.charAt(i));
            }
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int lsn = 65; lsn 65 int ssn = 97; ssn 97 char large[] = new char[26]; large new char[26] 26 char small[] = new char[26]; small new char[26] 26 char sign[] = {' ', ',', '.'}; sign {' ', ',', '.'} ' ' ',' '.' for (int i = 0; i < 26; i++) {
            large[i] = (char) lsn++;
            small[i] = (char) ssn++;
        } int i = 0; int i = 0; i 0 i < 26 i 26 i++ i++ i {
            large[i] = (char) lsn++;
            small[i] = (char) ssn++;
        } {
            large[i] = (char) lsn++;
            small[i] = (char) ssn++;
        } large[i] = (char) lsn++ large[i] large i (char) lsn++ lsn small[i] = (char) ssn++ small[i] small i (char) ssn++ ssn String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc StringBuilder ans = new StringBuilder(); ans new StringBuilder() for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            if (s.matches("[A-Z]")) {
                ans.append(s.toLowerCase());
            } else if (s.matches("[a-z]")) {
                ans.append(s.toUpperCase());
            } else {
                ans.append(str.charAt(i));
            }
        } int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
            String s = String.valueOf(str.charAt(i));
            if (s.matches("[A-Z]")) {
                ans.append(s.toLowerCase());
            } else if (s.matches("[a-z]")) {
                ans.append(s.toUpperCase());
            } else {
                ans.append(str.charAt(i));
            }
        } {
            String s = String.valueOf(str.charAt(i));
            if (s.matches("[A-Z]")) {
                ans.append(s.toLowerCase());
            } else if (s.matches("[a-z]")) {
                ans.append(s.toUpperCase());
            } else {
                ans.append(str.charAt(i));
            }
        } String s = String.valueOf(str.charAt(i)); s String.valueOf(str.charAt(i)) String.valueOf String str.charAt(i) str.charAt str i if (s.matches("[A-Z]")) {
                ans.append(s.toLowerCase());
            } else if (s.matches("[a-z]")) {
                ans.append(s.toUpperCase());
            } else {
                ans.append(str.charAt(i));
            } s.matches("[A-Z]") s.matches s "[A-Z]" {
                ans.append(s.toLowerCase());
            } ans.append(s.toLowerCase()) ans.append ans s.toLowerCase() s.toLowerCase s if (s.matches("[a-z]")) {
                ans.append(s.toUpperCase());
            } else {
                ans.append(str.charAt(i));
            } s.matches("[a-z]") s.matches s "[a-z]" {
                ans.append(s.toUpperCase());
            } ans.append(s.toUpperCase()) ans.append ans s.toUpperCase() s.toUpperCase s {
                ans.append(str.charAt(i));
            } ans.append(str.charAt(i)) ans.append ans str.charAt(i) str.charAt str i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int lsn = 65;
        int ssn = 97;

        char large[] = new char[26];
        char small[] = new char[26];
        char sign[] = {' ', ',', '.'};

        for (int i = 0; i < 26; i++) {
            large[i] = (char) lsn++;
            small[i] = (char) ssn++;
        }

        String str = sc.nextLine();
        StringBuilder ans = new StringBuilder();

        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            if (s.matches("[A-Z]")) {
                ans.append(s.toLowerCase());
            } else if (s.matches("[a-z]")) {
                ans.append(s.toUpperCase());
            } else {
                ans.append(str.charAt(i));
            }
        }
        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int lsn = 65;
        int ssn = 97;

        char large[] = new char[26];
        char small[] = new char[26];
        char sign[] = {' ', ',', '.'};

        for (int i = 0; i < 26; i++) {
            large[i] = (char) lsn++;
            small[i] = (char) ssn++;
        }

        String str = sc.nextLine();
        StringBuilder ans = new StringBuilder();

        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            if (s.matches("[A-Z]")) {
                ans.append(s.toLowerCase());
            } else if (s.matches("[a-z]")) {
                ans.append(s.toUpperCase());
            } else {
                ans.append(str.charAt(i));
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int lsn = 65;
        int ssn = 97;

        char large[] = new char[26];
        char small[] = new char[26];
        char sign[] = {' ', ',', '.'};

        for (int i = 0; i < 26; i++) {
            large[i] = (char) lsn++;
            small[i] = (char) ssn++;
        }

        String str = sc.nextLine();
        StringBuilder ans = new StringBuilder();

        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            if (s.matches("[A-Z]")) {
                ans.append(s.toLowerCase());
            } else if (s.matches("[a-z]")) {
                ans.append(s.toUpperCase());
            } else {
                ans.append(str.charAt(i));
            }
        }
        System.out.println(ans);
    }
}