import java.util.Scanner;

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

        for (String s : S.split("")) {
            if (Character.isLowerCase(s.charAt(0))) {
                System.out.print(Character.toUpperCase(s.charAt(0)));
            } else if (Character.isUpperCase(s.charAt(0))) {
                System.out.print(Character.toLowerCase(s.charAt(0)));
            } else {
                System.out.print(s);
            }
        }
        System.out.println();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();

        for (String s : S.split("")) {
            if (Character.isLowerCase(s.charAt(0))) {
                System.out.print(Character.toUpperCase(s.charAt(0)));
            } else if (Character.isUpperCase(s.charAt(0))) {
                System.out.print(Character.toLowerCase(s.charAt(0)));
            } else {
                System.out.print(s);
            }
        }
        System.out.println();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();

        for (String s : S.split("")) {
            if (Character.isLowerCase(s.charAt(0))) {
                System.out.print(Character.toUpperCase(s.charAt(0)));
            } else if (Character.isUpperCase(s.charAt(0))) {
                System.out.print(Character.toLowerCase(s.charAt(0)));
            } else {
                System.out.print(s);
            }
        }
        System.out.println();
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();

        for (String s : S.split("")) {
            if (Character.isLowerCase(s.charAt(0))) {
                System.out.print(Character.toUpperCase(s.charAt(0)));
            } else if (Character.isUpperCase(s.charAt(0))) {
                System.out.print(Character.toLowerCase(s.charAt(0)));
            } else {
                System.out.print(s);
            }
        }
        System.out.println();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc for (String s : S.split("")) {
            if (Character.isLowerCase(s.charAt(0))) {
                System.out.print(Character.toUpperCase(s.charAt(0)));
            } else if (Character.isUpperCase(s.charAt(0))) {
                System.out.print(Character.toLowerCase(s.charAt(0)));
            } else {
                System.out.print(s);
            }
        } String s S.split("") S.split S "" {
            if (Character.isLowerCase(s.charAt(0))) {
                System.out.print(Character.toUpperCase(s.charAt(0)));
            } else if (Character.isUpperCase(s.charAt(0))) {
                System.out.print(Character.toLowerCase(s.charAt(0)));
            } else {
                System.out.print(s);
            }
        } {
            if (Character.isLowerCase(s.charAt(0))) {
                System.out.print(Character.toUpperCase(s.charAt(0)));
            } else if (Character.isUpperCase(s.charAt(0))) {
                System.out.print(Character.toLowerCase(s.charAt(0)));
            } else {
                System.out.print(s);
            }
        } if (Character.isLowerCase(s.charAt(0))) {
                System.out.print(Character.toUpperCase(s.charAt(0)));
            } else if (Character.isUpperCase(s.charAt(0))) {
                System.out.print(Character.toLowerCase(s.charAt(0)));
            } else {
                System.out.print(s);
            } Character.isLowerCase(s.charAt(0)) Character.isLowerCase Character s.charAt(0) s.charAt s 0 {
                System.out.print(Character.toUpperCase(s.charAt(0)));
            } System.out.print(Character.toUpperCase(s.charAt(0))) System.out.print System.out System System.out Character.toUpperCase(s.charAt(0)) Character.toUpperCase Character s.charAt(0) s.charAt s 0 if (Character.isUpperCase(s.charAt(0))) {
                System.out.print(Character.toLowerCase(s.charAt(0)));
            } else {
                System.out.print(s);
            } Character.isUpperCase(s.charAt(0)) Character.isUpperCase Character s.charAt(0) s.charAt s 0 {
                System.out.print(Character.toLowerCase(s.charAt(0)));
            } System.out.print(Character.toLowerCase(s.charAt(0))) System.out.print System.out System System.out Character.toLowerCase(s.charAt(0)) Character.toLowerCase Character s.charAt(0) s.charAt s 0 {
                System.out.print(s);
            } System.out.print(s) System.out.print System.out System System.out s System.out.println() System.out.println System.out System System.out String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();

        for (String s : S.split("")) {
            if (Character.isLowerCase(s.charAt(0))) {
                System.out.print(Character.toUpperCase(s.charAt(0)));
            } else if (Character.isUpperCase(s.charAt(0))) {
                System.out.print(Character.toLowerCase(s.charAt(0)));
            } else {
                System.out.print(s);
            }
        }
        System.out.println();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();

        for (String s : S.split("")) {
            if (Character.isLowerCase(s.charAt(0))) {
                System.out.print(Character.toUpperCase(s.charAt(0)));
            } else if (Character.isUpperCase(s.charAt(0))) {
                System.out.print(Character.toLowerCase(s.charAt(0)));
            } else {
                System.out.print(s);
            }
        }
        System.out.println();
    }
} Main
import java.util.Scanner;

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

        for (String s : S.split("")) {
            if (Character.isLowerCase(s.charAt(0))) {
                System.out.print(Character.toUpperCase(s.charAt(0)));
            } else if (Character.isUpperCase(s.charAt(0))) {
                System.out.print(Character.toLowerCase(s.charAt(0)));
            } else {
                System.out.print(s);
            }
        }
        System.out.println();
    }
}