import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        StringBuilder sb = new StringBuilder();
        for(int i=0;i<str.length();i++){
            if(Character.isUpperCase(str.charAt(i))){
                sb.append(str.substring(i,i+1).toLowerCase());
            }else{
                sb.append(str.substring(i,i+1).toUpperCase());
            }
        }
        sb.append("\n");
        System.out.print(sb);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        StringBuilder sb = new StringBuilder();
        for(int i=0;i<str.length();i++){
            if(Character.isUpperCase(str.charAt(i))){
                sb.append(str.substring(i,i+1).toLowerCase());
            }else{
                sb.append(str.substring(i,i+1).toUpperCase());
            }
        }
        sb.append("\n");
        System.out.print(sb);
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        StringBuilder sb = new StringBuilder();
        for(int i=0;i<str.length();i++){
            if(Character.isUpperCase(str.charAt(i))){
                sb.append(str.substring(i,i+1).toLowerCase());
            }else{
                sb.append(str.substring(i,i+1).toUpperCase());
            }
        }
        sb.append("\n");
        System.out.print(sb);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        StringBuilder sb = new StringBuilder();
        for(int i=0;i<str.length();i++){
            if(Character.isUpperCase(str.charAt(i))){
                sb.append(str.substring(i,i+1).toLowerCase());
            }else{
                sb.append(str.substring(i,i+1).toUpperCase());
            }
        }
        sb.append("\n");
        System.out.print(sb);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str = br.readLine(); str br.readLine() br.readLine br StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i=0;i<str.length();i++){
            if(Character.isUpperCase(str.charAt(i))){
                sb.append(str.substring(i,i+1).toLowerCase());
            }else{
                sb.append(str.substring(i,i+1).toUpperCase());
            }
        } int i=0; int i=0; i 0 i<str.length() i str.length() str.length str i++ i++ i {
            if(Character.isUpperCase(str.charAt(i))){
                sb.append(str.substring(i,i+1).toLowerCase());
            }else{
                sb.append(str.substring(i,i+1).toUpperCase());
            }
        } {
            if(Character.isUpperCase(str.charAt(i))){
                sb.append(str.substring(i,i+1).toLowerCase());
            }else{
                sb.append(str.substring(i,i+1).toUpperCase());
            }
        } if(Character.isUpperCase(str.charAt(i))){
                sb.append(str.substring(i,i+1).toLowerCase());
            }else{
                sb.append(str.substring(i,i+1).toUpperCase());
            } Character.isUpperCase(str.charAt(i)) Character.isUpperCase Character str.charAt(i) str.charAt str i {
                sb.append(str.substring(i,i+1).toLowerCase());
            } sb.append(str.substring(i,i+1).toLowerCase()) sb.append sb str.substring(i,i+1).toLowerCase() str.substring(i,i+1).toLowerCase str.substring(i,i+1) str.substring str i i+1 i 1 {
                sb.append(str.substring(i,i+1).toUpperCase());
            } sb.append(str.substring(i,i+1).toUpperCase()) sb.append sb str.substring(i,i+1).toUpperCase() str.substring(i,i+1).toUpperCase str.substring(i,i+1) str.substring str i i+1 i 1 sb.append("\n") sb.append sb "\n" System.out.print(sb) System.out.print System.out System System.out sb String[] args args public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        StringBuilder sb = new StringBuilder();
        for(int i=0;i<str.length();i++){
            if(Character.isUpperCase(str.charAt(i))){
                sb.append(str.substring(i,i+1).toLowerCase());
            }else{
                sb.append(str.substring(i,i+1).toUpperCase());
            }
        }
        sb.append("\n");
        System.out.print(sb);
    }
} public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        StringBuilder sb = new StringBuilder();
        for(int i=0;i<str.length();i++){
            if(Character.isUpperCase(str.charAt(i))){
                sb.append(str.substring(i,i+1).toLowerCase());
            }else{
                sb.append(str.substring(i,i+1).toUpperCase());
            }
        }
        sb.append("\n");
        System.out.print(sb);
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        StringBuilder sb = new StringBuilder();
        for(int i=0;i<str.length();i++){
            if(Character.isUpperCase(str.charAt(i))){
                sb.append(str.substring(i,i+1).toLowerCase());
            }else{
                sb.append(str.substring(i,i+1).toUpperCase());
            }
        }
        sb.append("\n");
        System.out.print(sb);
    }
}