import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        System.out.println(Main.change(str));
        }

    public static String change(String str){
        String[] array = str.split("");
        int len = array.length;
        String stack = "";
        for(int i=0; i<len; i++){
            String ar = array[i];
            if(ar.matches("[A-Z]")){
                stack += ar.toLowerCase();
            }
            else{
                stack += ar.toUpperCase();
            }
        }
        return stack;
    }
}
 import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        System.out.println(Main.change(str));
        }

    public static String change(String str){
        String[] array = str.split("");
        int len = array.length;
        String stack = "";
        for(int i=0; i<len; i++){
            String ar = array[i];
            if(ar.matches("[A-Z]")){
                stack += ar.toLowerCase();
            }
            else{
                stack += ar.toUpperCase();
            }
        }
        return stack;
    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        System.out.println(Main.change(str));
        } main {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        System.out.println(Main.change(str));
        } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String str = scan.nextLine(); str scan.nextLine() scan.nextLine scan System.out.println(Main.change(str)) System.out.println System.out System System.out Main.change(str) Main.change Main str String[] args args public static String change(String str){
        String[] array = str.split("");
        int len = array.length;
        String stack = "";
        for(int i=0; i<len; i++){
            String ar = array[i];
            if(ar.matches("[A-Z]")){
                stack += ar.toLowerCase();
            }
            else{
                stack += ar.toUpperCase();
            }
        }
        return stack;
    } change {
        String[] array = str.split("");
        int len = array.length;
        String stack = "";
        for(int i=0; i<len; i++){
            String ar = array[i];
            if(ar.matches("[A-Z]")){
                stack += ar.toLowerCase();
            }
            else{
                stack += ar.toUpperCase();
            }
        }
        return stack;
    } String[] array = str.split(""); array str.split("") str.split str "" int len = array.length; len array.length array array.length String stack = ""; stack "" for(int i=0; i<len; i++){
            String ar = array[i];
            if(ar.matches("[A-Z]")){
                stack += ar.toLowerCase();
            }
            else{
                stack += ar.toUpperCase();
            }
        } int i=0; int i=0; i 0 i<len i len i++ i++ i {
            String ar = array[i];
            if(ar.matches("[A-Z]")){
                stack += ar.toLowerCase();
            }
            else{
                stack += ar.toUpperCase();
            }
        } {
            String ar = array[i];
            if(ar.matches("[A-Z]")){
                stack += ar.toLowerCase();
            }
            else{
                stack += ar.toUpperCase();
            }
        } String ar = array[i]; ar array[i] array i if(ar.matches("[A-Z]")){
                stack += ar.toLowerCase();
            }
            else{
                stack += ar.toUpperCase();
            } ar.matches("[A-Z]") ar.matches ar "[A-Z]" {
                stack += ar.toLowerCase();
            } stack += ar.toLowerCase() stack ar.toLowerCase() ar.toLowerCase ar {
                stack += ar.toUpperCase();
            } stack += ar.toUpperCase() stack ar.toUpperCase() ar.toUpperCase ar return stack; stack String str str public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        System.out.println(Main.change(str));
        }

    public static String change(String str){
        String[] array = str.split("");
        int len = array.length;
        String stack = "";
        for(int i=0; i<len; i++){
            String ar = array[i];
            if(ar.matches("[A-Z]")){
                stack += ar.toLowerCase();
            }
            else{
                stack += ar.toUpperCase();
            }
        }
        return stack;
    }
} public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        System.out.println(Main.change(str));
        }

    public static String change(String str){
        String[] array = str.split("");
        int len = array.length;
        String stack = "";
        for(int i=0; i<len; i++){
            String ar = array[i];
            if(ar.matches("[A-Z]")){
                stack += ar.toLowerCase();
            }
            else{
                stack += ar.toUpperCase();
            }
        }
        return stack;
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        System.out.println(Main.change(str));
        }

    public static String change(String str){
        String[] array = str.split("");
        int len = array.length;
        String stack = "";
        for(int i=0; i<len; i++){
            String ar = array[i];
            if(ar.matches("[A-Z]")){
                stack += ar.toLowerCase();
            }
            else{
                stack += ar.toUpperCase();
            }
        }
        return stack;
    }
}

