import java.util.Scanner;
 
class Main {
    Scanner sc = new Scanner(System.in);
 
    public void run() {
        String str=sc.nextLine();
         
        char[] c=str.toCharArray();
        for(int i=0;i<c.length;i++){
            if('a'<=c[i] &&c[i]<='z'){
                c[i]=(char)(c[i]-'a'+'A');
            }else if('A'<=c[i] &&c[i]<='Z'){
                c[i]=(char)(c[i]-'A'+'a');
            }
        }
        ln(String.copyValueOf(c));
    }
    public static void main(String[] args) {
        new Main().run();
    }
 
    public static void pr(Object o) {
        System.out.print(o);
    }
 
    public static void ln(Object o) {
        System.out.println(o);
    }
 
    public static void ln() {
        System.out.println();
    }
} import java.util.Scanner; Scanner java.util class Main {
    Scanner sc = new Scanner(System.in);
 
    public void run() {
        String str=sc.nextLine();
         
        char[] c=str.toCharArray();
        for(int i=0;i<c.length;i++){
            if('a'<=c[i] &&c[i]<='z'){
                c[i]=(char)(c[i]-'a'+'A');
            }else if('A'<=c[i] &&c[i]<='Z'){
                c[i]=(char)(c[i]-'A'+'a');
            }
        }
        ln(String.copyValueOf(c));
    }
    public static void main(String[] args) {
        new Main().run();
    }
 
    public static void pr(Object o) {
        System.out.print(o);
    }
 
    public static void ln(Object o) {
        System.out.println(o);
    }
 
    public static void ln() {
        System.out.println();
    }
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public void run() {
        String str=sc.nextLine();
         
        char[] c=str.toCharArray();
        for(int i=0;i<c.length;i++){
            if('a'<=c[i] &&c[i]<='z'){
                c[i]=(char)(c[i]-'a'+'A');
            }else if('A'<=c[i] &&c[i]<='Z'){
                c[i]=(char)(c[i]-'A'+'a');
            }
        }
        ln(String.copyValueOf(c));
    } run {
        String str=sc.nextLine();
         
        char[] c=str.toCharArray();
        for(int i=0;i<c.length;i++){
            if('a'<=c[i] &&c[i]<='z'){
                c[i]=(char)(c[i]-'a'+'A');
            }else if('A'<=c[i] &&c[i]<='Z'){
                c[i]=(char)(c[i]-'A'+'a');
            }
        }
        ln(String.copyValueOf(c));
    } String str=sc.nextLine(); str sc.nextLine() sc.nextLine sc char[] c=str.toCharArray(); c str.toCharArray() str.toCharArray str for(int i=0;i<c.length;i++){
            if('a'<=c[i] &&c[i]<='z'){
                c[i]=(char)(c[i]-'a'+'A');
            }else if('A'<=c[i] &&c[i]<='Z'){
                c[i]=(char)(c[i]-'A'+'a');
            }
        } int i=0; int i=0; i 0 i<c.length i c.length c c.length i++ i++ i {
            if('a'<=c[i] &&c[i]<='z'){
                c[i]=(char)(c[i]-'a'+'A');
            }else if('A'<=c[i] &&c[i]<='Z'){
                c[i]=(char)(c[i]-'A'+'a');
            }
        } {
            if('a'<=c[i] &&c[i]<='z'){
                c[i]=(char)(c[i]-'a'+'A');
            }else if('A'<=c[i] &&c[i]<='Z'){
                c[i]=(char)(c[i]-'A'+'a');
            }
        } if('a'<=c[i] &&c[i]<='z'){
                c[i]=(char)(c[i]-'a'+'A');
            }else if('A'<=c[i] &&c[i]<='Z'){
                c[i]=(char)(c[i]-'A'+'a');
            } 'a'<=c[i] &&c[i]<='z' 'a'<=c[i] 'a' c[i] c i c[i]<='z' c[i] c i 'z' {
                c[i]=(char)(c[i]-'a'+'A');
            } c[i]=(char)(c[i]-'a'+'A') c[i] c i (char)(c[i]-'a'+'A') c[i]-'a' c[i] c i 'a' 'A' if('A'<=c[i] &&c[i]<='Z'){
                c[i]=(char)(c[i]-'A'+'a');
            } 'A'<=c[i] &&c[i]<='Z' 'A'<=c[i] 'A' c[i] c i c[i]<='Z' c[i] c i 'Z' {
                c[i]=(char)(c[i]-'A'+'a');
            } c[i]=(char)(c[i]-'A'+'a') c[i] c i (char)(c[i]-'A'+'a') c[i]-'A' c[i] c i 'A' 'a' ln(String.copyValueOf(c)) ln String.copyValueOf(c) String.copyValueOf String c public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args public static void pr(Object o) {
        System.out.print(o);
    } pr {
        System.out.print(o);
    } System.out.print(o) System.out.print System.out System System.out o Object o o public static void ln(Object o) {
        System.out.println(o);
    } ln {
        System.out.println(o);
    } System.out.println(o) System.out.println System.out System System.out o Object o o public static void ln() {
        System.out.println();
    } ln {
        System.out.println();
    } System.out.println() System.out.println System.out System System.out
import java.util.Scanner;
 
class Main {
    Scanner sc = new Scanner(System.in);
 
    public void run() {
        String str=sc.nextLine();
         
        char[] c=str.toCharArray();
        for(int i=0;i<c.length;i++){
            if('a'<=c[i] &&c[i]<='z'){
                c[i]=(char)(c[i]-'a'+'A');
            }else if('A'<=c[i] &&c[i]<='Z'){
                c[i]=(char)(c[i]-'A'+'a');
            }
        }
        ln(String.copyValueOf(c));
    }
    public static void main(String[] args) {
        new Main().run();
    }
 
    public static void pr(Object o) {
        System.out.print(o);
    }
 
    public static void ln(Object o) {
        System.out.println(o);
    }
 
    public static void ln() {
        System.out.println();
    }
}
