import java.io.*;
 
class Main {
    public static void main(String[] arg)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        int l = str.length();
        char ch[] = str.toCharArray();
        for(int i=0;i<l;i++){
            if(Character.isUpperCase(ch[i])){
                ch[i] = Character.toLowerCase(ch[i]);
            }
            else if(Character.isLowerCase(ch[i])){
                ch[i] = Character.toUpperCase(ch[i]);               
            }
        }
        System.out.println(ch);     
    }
}    import java.io.*; io.* java class Main {
    public static void main(String[] arg)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        int l = str.length();
        char ch[] = str.toCharArray();
        for(int i=0;i<l;i++){
            if(Character.isUpperCase(ch[i])){
                ch[i] = Character.toLowerCase(ch[i]);
            }
            else if(Character.isLowerCase(ch[i])){
                ch[i] = Character.toUpperCase(ch[i]);               
            }
        }
        System.out.println(ch);     
    }
} Main public static void main(String[] arg)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        int l = str.length();
        char ch[] = str.toCharArray();
        for(int i=0;i<l;i++){
            if(Character.isUpperCase(ch[i])){
                ch[i] = Character.toLowerCase(ch[i]);
            }
            else if(Character.isLowerCase(ch[i])){
                ch[i] = Character.toUpperCase(ch[i]);               
            }
        }
        System.out.println(ch);     
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        int l = str.length();
        char ch[] = str.toCharArray();
        for(int i=0;i<l;i++){
            if(Character.isUpperCase(ch[i])){
                ch[i] = Character.toLowerCase(ch[i]);
            }
            else if(Character.isLowerCase(ch[i])){
                ch[i] = Character.toUpperCase(ch[i]);               
            }
        }
        System.out.println(ch);     
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str = br.readLine(); str br.readLine() br.readLine br int l = str.length(); l str.length() str.length str char ch[] = str.toCharArray(); ch str.toCharArray() str.toCharArray str for(int i=0;i<l;i++){
            if(Character.isUpperCase(ch[i])){
                ch[i] = Character.toLowerCase(ch[i]);
            }
            else if(Character.isLowerCase(ch[i])){
                ch[i] = Character.toUpperCase(ch[i]);               
            }
        } int i=0; int i=0; i 0 i<l i l i++ i++ i {
            if(Character.isUpperCase(ch[i])){
                ch[i] = Character.toLowerCase(ch[i]);
            }
            else if(Character.isLowerCase(ch[i])){
                ch[i] = Character.toUpperCase(ch[i]);               
            }
        } {
            if(Character.isUpperCase(ch[i])){
                ch[i] = Character.toLowerCase(ch[i]);
            }
            else if(Character.isLowerCase(ch[i])){
                ch[i] = Character.toUpperCase(ch[i]);               
            }
        } if(Character.isUpperCase(ch[i])){
                ch[i] = Character.toLowerCase(ch[i]);
            }
            else if(Character.isLowerCase(ch[i])){
                ch[i] = Character.toUpperCase(ch[i]);               
            } Character.isUpperCase(ch[i]) Character.isUpperCase Character ch[i] ch i {
                ch[i] = Character.toLowerCase(ch[i]);
            } ch[i] = Character.toLowerCase(ch[i]) ch[i] ch i Character.toLowerCase(ch[i]) Character.toLowerCase Character ch[i] ch i if(Character.isLowerCase(ch[i])){
                ch[i] = Character.toUpperCase(ch[i]);               
            } Character.isLowerCase(ch[i]) Character.isLowerCase Character ch[i] ch i {
                ch[i] = Character.toUpperCase(ch[i]);               
            } ch[i] = Character.toUpperCase(ch[i]) ch[i] ch i Character.toUpperCase(ch[i]) Character.toUpperCase Character ch[i] ch i System.out.println(ch) System.out.println System.out System System.out ch String[] arg arg
import java.io.*;
 
class Main {
    public static void main(String[] arg)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        int l = str.length();
        char ch[] = str.toCharArray();
        for(int i=0;i<l;i++){
            if(Character.isUpperCase(ch[i])){
                ch[i] = Character.toLowerCase(ch[i]);
            }
            else if(Character.isLowerCase(ch[i])){
                ch[i] = Character.toUpperCase(ch[i]);               
            }
        }
        System.out.println(ch);     
    }
}   