import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String s = input.nextLine();

        for (char c : s.toCharArray()){
            if ('A' <= c && c <= 'Z'){
                System.out.print(Character.toLowerCase(c));
            }
            else if ('a' <= c && c <= 'z'){
                System.out.print(Character.toUpperCase(c));
            }
            else {
                System.out.print(c);
            }
        }
        System.out.println();
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String s = input.nextLine();

        for (char c : s.toCharArray()){
            if ('A' <= c && c <= 'Z'){
                System.out.print(Character.toLowerCase(c));
            }
            else if ('a' <= c && c <= 'z'){
                System.out.print(Character.toUpperCase(c));
            }
            else {
                System.out.print(c);
            }
        }
        System.out.println();
    }
} Main public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String s = input.nextLine();

        for (char c : s.toCharArray()){
            if ('A' <= c && c <= 'Z'){
                System.out.print(Character.toLowerCase(c));
            }
            else if ('a' <= c && c <= 'z'){
                System.out.print(Character.toUpperCase(c));
            }
            else {
                System.out.print(c);
            }
        }
        System.out.println();
    } main {
        Scanner input = new Scanner(System.in);
        String s = input.nextLine();

        for (char c : s.toCharArray()){
            if ('A' <= c && c <= 'Z'){
                System.out.print(Character.toLowerCase(c));
            }
            else if ('a' <= c && c <= 'z'){
                System.out.print(Character.toUpperCase(c));
            }
            else {
                System.out.print(c);
            }
        }
        System.out.println();
    } Scanner input = new Scanner(System.in); input new Scanner(System.in) String s = input.nextLine(); s input.nextLine() input.nextLine input for (char c : s.toCharArray()){
            if ('A' <= c && c <= 'Z'){
                System.out.print(Character.toLowerCase(c));
            }
            else if ('a' <= c && c <= 'z'){
                System.out.print(Character.toUpperCase(c));
            }
            else {
                System.out.print(c);
            }
        } char c s.toCharArray() s.toCharArray s {
            if ('A' <= c && c <= 'Z'){
                System.out.print(Character.toLowerCase(c));
            }
            else if ('a' <= c && c <= 'z'){
                System.out.print(Character.toUpperCase(c));
            }
            else {
                System.out.print(c);
            }
        } {
            if ('A' <= c && c <= 'Z'){
                System.out.print(Character.toLowerCase(c));
            }
            else if ('a' <= c && c <= 'z'){
                System.out.print(Character.toUpperCase(c));
            }
            else {
                System.out.print(c);
            }
        } if ('A' <= c && c <= 'Z'){
                System.out.print(Character.toLowerCase(c));
            }
            else if ('a' <= c && c <= 'z'){
                System.out.print(Character.toUpperCase(c));
            }
            else {
                System.out.print(c);
            } 'A' <= c && c <= 'Z' 'A' <= c 'A' c c <= 'Z' c 'Z' {
                System.out.print(Character.toLowerCase(c));
            } System.out.print(Character.toLowerCase(c)) System.out.print System.out System System.out Character.toLowerCase(c) Character.toLowerCase Character c if ('a' <= c && c <= 'z'){
                System.out.print(Character.toUpperCase(c));
            }
            else {
                System.out.print(c);
            } 'a' <= c && c <= 'z' 'a' <= c 'a' c c <= 'z' c 'z' {
                System.out.print(Character.toUpperCase(c));
            } System.out.print(Character.toUpperCase(c)) System.out.print System.out System System.out Character.toUpperCase(c) Character.toUpperCase Character c {
                System.out.print(c);
            } System.out.print(c) System.out.print System.out System System.out c System.out.println() System.out.println System.out System System.out String[] args args
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String s = input.nextLine();

        for (char c : s.toCharArray()){
            if ('A' <= c && c <= 'Z'){
                System.out.print(Character.toLowerCase(c));
            }
            else if ('a' <= c && c <= 'z'){
                System.out.print(Character.toUpperCase(c));
            }
            else {
                System.out.print(c);
            }
        }
        System.out.println();
    }
}