import java.util.Scanner;
import java.util.function.Function;

public class Main {

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

    Scanner sc = new Scanner(System.in);

    void solve() {
        String str = sc.nextLine();
        char[] c = str.toCharArray();
        for (int i = 0; i < str.length(); ++i) {
            System.out.print(converter(c[i]));
        }
        System.out.println("");
    }

    char converter(char c) {
        if (Character.isUpperCase(c))
            return Character.toLowerCase(c);
        if (Character.isLowerCase(c))
            return Character.toUpperCase(c);
        return c;
    }
}



 import java.util.Scanner; Scanner java.util import java.util.function.Function; Function java.util.function public class Main {

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

    Scanner sc = new Scanner(System.in);

    void solve() {
        String str = sc.nextLine();
        char[] c = str.toCharArray();
        for (int i = 0; i < str.length(); ++i) {
            System.out.print(converter(c[i]));
        }
        System.out.println("");
    }

    char converter(char c) {
        if (Character.isUpperCase(c))
            return Character.toLowerCase(c);
        if (Character.isLowerCase(c))
            return Character.toUpperCase(c);
        return c;
    }
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        new Main().solve();
    } main {
        new Main().solve();
    } new Main().solve() new Main().solve new Main() String[] args args void solve() {
        String str = sc.nextLine();
        char[] c = str.toCharArray();
        for (int i = 0; i < str.length(); ++i) {
            System.out.print(converter(c[i]));
        }
        System.out.println("");
    } solve {
        String str = sc.nextLine();
        char[] c = str.toCharArray();
        for (int i = 0; i < str.length(); ++i) {
            System.out.print(converter(c[i]));
        }
        System.out.println("");
    } 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 < str.length(); ++i) {
            System.out.print(converter(c[i]));
        } int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str ++i ++i i {
            System.out.print(converter(c[i]));
        } {
            System.out.print(converter(c[i]));
        } System.out.print(converter(c[i])) System.out.print System.out System System.out converter(c[i]) converter c[i] c i System.out.println("") System.out.println System.out System System.out "" char converter(char c) {
        if (Character.isUpperCase(c))
            return Character.toLowerCase(c);
        if (Character.isLowerCase(c))
            return Character.toUpperCase(c);
        return c;
    } converter {
        if (Character.isUpperCase(c))
            return Character.toLowerCase(c);
        if (Character.isLowerCase(c))
            return Character.toUpperCase(c);
        return c;
    } if (Character.isUpperCase(c))
            return Character.toLowerCase(c); Character.isUpperCase(c) Character.isUpperCase Character c return Character.toLowerCase(c); Character.toLowerCase(c) Character.toLowerCase Character c if (Character.isLowerCase(c))
            return Character.toUpperCase(c); Character.isLowerCase(c) Character.isLowerCase Character c return Character.toUpperCase(c); Character.toUpperCase(c) Character.toUpperCase Character c return c; c char c c public class Main {

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

    Scanner sc = new Scanner(System.in);

    void solve() {
        String str = sc.nextLine();
        char[] c = str.toCharArray();
        for (int i = 0; i < str.length(); ++i) {
            System.out.print(converter(c[i]));
        }
        System.out.println("");
    }

    char converter(char c) {
        if (Character.isUpperCase(c))
            return Character.toLowerCase(c);
        if (Character.isLowerCase(c))
            return Character.toUpperCase(c);
        return c;
    }
} public class Main {

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

    Scanner sc = new Scanner(System.in);

    void solve() {
        String str = sc.nextLine();
        char[] c = str.toCharArray();
        for (int i = 0; i < str.length(); ++i) {
            System.out.print(converter(c[i]));
        }
        System.out.println("");
    }

    char converter(char c) {
        if (Character.isUpperCase(c))
            return Character.toLowerCase(c);
        if (Character.isLowerCase(c))
            return Character.toUpperCase(c);
        return c;
    }
} Main
import java.util.Scanner;
import java.util.function.Function;

public class Main {

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

    Scanner sc = new Scanner(System.in);

    void solve() {
        String str = sc.nextLine();
        char[] c = str.toCharArray();
        for (int i = 0; i < str.length(); ++i) {
            System.out.print(converter(c[i]));
        }
        System.out.println("");
    }

    char converter(char c) {
        if (Character.isUpperCase(c))
            return Character.toLowerCase(c);
        if (Character.isLowerCase(c))
            return Character.toUpperCase(c);
        return c;
    }
}




