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 strin=br.readLine();
		String[] str=strin.split("");
		
		for(String i:str){
			if(i.equals(i.toLowerCase())){
				System.out.print(i.toUpperCase());
			}else System.out.print(i.toLowerCase());
		}
		
		System.out.println();
		}} 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 strin=br.readLine();
		String[] str=strin.split("");
		
		for(String i:str){
			if(i.equals(i.toLowerCase())){
				System.out.print(i.toUpperCase());
			}else System.out.print(i.toLowerCase());
		}
		
		System.out.println();
		}} Main public static void main(String[] args) throws IOException{
		// 入力導入部
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		
		String strin=br.readLine();
		String[] str=strin.split("");
		
		for(String i:str){
			if(i.equals(i.toLowerCase())){
				System.out.print(i.toUpperCase());
			}else System.out.print(i.toLowerCase());
		}
		
		System.out.println();
		} main {
		// 入力導入部
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		
		String strin=br.readLine();
		String[] str=strin.split("");
		
		for(String i:str){
			if(i.equals(i.toLowerCase())){
				System.out.print(i.toUpperCase());
			}else System.out.print(i.toLowerCase());
		}
		
		System.out.println();
		} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String strin=br.readLine(); strin br.readLine() br.readLine br String[] str=strin.split(""); str strin.split("") strin.split strin "" for(String i:str){
			if(i.equals(i.toLowerCase())){
				System.out.print(i.toUpperCase());
			}else System.out.print(i.toLowerCase());
		} String i str {
			if(i.equals(i.toLowerCase())){
				System.out.print(i.toUpperCase());
			}else System.out.print(i.toLowerCase());
		} {
			if(i.equals(i.toLowerCase())){
				System.out.print(i.toUpperCase());
			}else System.out.print(i.toLowerCase());
		} if(i.equals(i.toLowerCase())){
				System.out.print(i.toUpperCase());
			}else System.out.print(i.toLowerCase()); i.equals(i.toLowerCase()) i.equals i i.toLowerCase() i.toLowerCase i {
				System.out.print(i.toUpperCase());
			} System.out.print(i.toUpperCase()) System.out.print System.out System System.out i.toUpperCase() i.toUpperCase i System.out.print(i.toLowerCase()) System.out.print System.out System System.out i.toLowerCase() i.toLowerCase i System.out.println() System.out.println System.out System System.out String[] args args public class Main {

	public static void main(String[] args) throws IOException{
		// 入力導入部
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		
		String strin=br.readLine();
		String[] str=strin.split("");
		
		for(String i:str){
			if(i.equals(i.toLowerCase())){
				System.out.print(i.toUpperCase());
			}else System.out.print(i.toLowerCase());
		}
		
		System.out.println();
		}} public class Main {

	public static void main(String[] args) throws IOException{
		// 入力導入部
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		
		String strin=br.readLine();
		String[] str=strin.split("");
		
		for(String i:str){
			if(i.equals(i.toLowerCase())){
				System.out.print(i.toUpperCase());
			}else System.out.print(i.toLowerCase());
		}
		
		System.out.println();
		}} 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 strin=br.readLine();
		String[] str=strin.split("");
		
		for(String i:str){
			if(i.equals(i.toLowerCase())){
				System.out.print(i.toUpperCase());
			}else System.out.print(i.toLowerCase());
		}
		
		System.out.println();
		}}