/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br =
        new BufferedReader(new InputStreamReader(System.in));
        
        String line = br.readLine();
		String ans = "";
        
    	for (int i = 0; i < line.length(); i++) {
    		String s = line.substring(i, i+1);
    		if (s.equals(s.toUpperCase())) {
    			ans += s.toLowerCase();
    		}
    		else {
    			ans += s.toUpperCase();
    		}
    	}   
    	
    	System.out.println(ans);
	}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br =
        new BufferedReader(new InputStreamReader(System.in));
        
        String line = br.readLine();
		String ans = "";
        
    	for (int i = 0; i < line.length(); i++) {
    		String s = line.substring(i, i+1);
    		if (s.equals(s.toUpperCase())) {
    			ans += s.toLowerCase();
    		}
    		else {
    			ans += s.toUpperCase();
    		}
    	}   
    	
    	System.out.println(ans);
	}
} Main public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br =
        new BufferedReader(new InputStreamReader(System.in));
        
        String line = br.readLine();
		String ans = "";
        
    	for (int i = 0; i < line.length(); i++) {
    		String s = line.substring(i, i+1);
    		if (s.equals(s.toUpperCase())) {
    			ans += s.toLowerCase();
    		}
    		else {
    			ans += s.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 s = line.substring(i, i+1);
    		if (s.equals(s.toUpperCase())) {
    			ans += s.toLowerCase();
    		}
    		else {
    			ans += s.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 s = line.substring(i, i+1);
    		if (s.equals(s.toUpperCase())) {
    			ans += s.toLowerCase();
    		}
    		else {
    			ans += s.toUpperCase();
    		}
    	} int i = 0; int i = 0; i 0 i < line.length() i line.length() line.length line i++ i++ i {
    		String s = line.substring(i, i+1);
    		if (s.equals(s.toUpperCase())) {
    			ans += s.toLowerCase();
    		}
    		else {
    			ans += s.toUpperCase();
    		}
    	} {
    		String s = line.substring(i, i+1);
    		if (s.equals(s.toUpperCase())) {
    			ans += s.toLowerCase();
    		}
    		else {
    			ans += s.toUpperCase();
    		}
    	} String s = line.substring(i, i+1); s line.substring(i, i+1) line.substring line i i+1 i 1 if (s.equals(s.toUpperCase())) {
    			ans += s.toLowerCase();
    		}
    		else {
    			ans += s.toUpperCase();
    		} s.equals(s.toUpperCase()) s.equals s s.toUpperCase() s.toUpperCase s {
    			ans += s.toLowerCase();
    		} ans += s.toLowerCase() ans s.toLowerCase() s.toLowerCase s {
    			ans += s.toUpperCase();
    		} ans += s.toUpperCase() ans s.toUpperCase() s.toUpperCase s System.out.println(ans) System.out.println System.out System System.out ans String[] args args
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br =
        new BufferedReader(new InputStreamReader(System.in));
        
        String line = br.readLine();
		String ans = "";
        
    	for (int i = 0; i < line.length(); i++) {
    		String s = line.substring(i, i+1);
    		if (s.equals(s.toUpperCase())) {
    			ans += s.toLowerCase();
    		}
    		else {
    			ans += s.toUpperCase();
    		}
    	}   
    	
    	System.out.println(ans);
	}
}