import java.io.*;

public class Main{
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        String ans = "";

        for(int i = 0; i < line.length(); i++){
            String str = line.substring(i, i+1);
            if(str.equals(str.toUpperCase())){
                ans += str.toLowerCase();
            }else{
                ans += str.toUpperCase();
            }
        }
        System.out.println(ans);
    }
} import java.io.*; io.* java public class Main{
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        String ans = "";

        for(int i = 0; i < line.length(); i++){
            String str = line.substring(i, i+1);
            if(str.equals(str.toUpperCase())){
                ans += str.toLowerCase();
            }else{
                ans += str.toUpperCase();
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        String ans = "";

        for(int i = 0; i < line.length(); i++){
            String str = line.substring(i, i+1);
            if(str.equals(str.toUpperCase())){
                ans += str.toLowerCase();
            }else{
                ans += str.toUpperCase();
            }
        }
        System.out.println(ans);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        String ans = "";

        for(int i = 0; i < line.length(); i++){
            String str = line.substring(i, i+1);
            if(str.equals(str.toUpperCase())){
                ans += str.toLowerCase();
            }else{
                ans += str.toUpperCase();
            }
        }
        System.out.println(ans);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line = br.readLine(); line br.readLine() br.readLine br String ans = ""; ans "" for(int i = 0; i < line.length(); i++){
            String str = line.substring(i, i+1);
            if(str.equals(str.toUpperCase())){
                ans += str.toLowerCase();
            }else{
                ans += str.toUpperCase();
            }
        } int i = 0; int i = 0; i 0 i < line.length() i line.length() line.length line i++ i++ i {
            String str = line.substring(i, i+1);
            if(str.equals(str.toUpperCase())){
                ans += str.toLowerCase();
            }else{
                ans += str.toUpperCase();
            }
        } {
            String str = line.substring(i, i+1);
            if(str.equals(str.toUpperCase())){
                ans += str.toLowerCase();
            }else{
                ans += str.toUpperCase();
            }
        } String str = line.substring(i, i+1); str line.substring(i, i+1) line.substring line i i+1 i 1 if(str.equals(str.toUpperCase())){
                ans += str.toLowerCase();
            }else{
                ans += str.toUpperCase();
            } str.equals(str.toUpperCase()) str.equals str str.toUpperCase() str.toUpperCase str {
                ans += str.toLowerCase();
            } ans += str.toLowerCase() ans str.toLowerCase() str.toLowerCase str {
                ans += str.toUpperCase();
            } ans += str.toUpperCase() ans str.toUpperCase() str.toUpperCase str System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        String ans = "";

        for(int i = 0; i < line.length(); i++){
            String str = line.substring(i, i+1);
            if(str.equals(str.toUpperCase())){
                ans += str.toLowerCase();
            }else{
                ans += str.toUpperCase();
            }
        }
        System.out.println(ans);
    }
} public class Main{
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        String ans = "";

        for(int i = 0; i < line.length(); i++){
            String str = line.substring(i, i+1);
            if(str.equals(str.toUpperCase())){
                ans += str.toLowerCase();
            }else{
                ans += str.toUpperCase();
            }
        }
        System.out.println(ans);
    }
} Main
import java.io.*;

public class Main{
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        String ans = "";

        for(int i = 0; i < line.length(); i++){
            String str = line.substring(i, i+1);
            if(str.equals(str.toUpperCase())){
                ans += str.toLowerCase();
            }else{
                ans += str.toUpperCase();
            }
        }
        System.out.println(ans);
    }
}