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

public class Main {
	public static void main(String[] args){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		try{
			String str = br.readLine();
			for(int i=0;i<str.length();i++){
				if(Character.isUpperCase(str.charAt(i))){
					sb.append(str.toLowerCase().charAt(i));
				}else{
					sb.append(str.toUpperCase().charAt(i));
				}
			}
			System.out.println(sb);
		}catch(Exception e){
			System.err.println(e);
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		try{
			String str = br.readLine();
			for(int i=0;i<str.length();i++){
				if(Character.isUpperCase(str.charAt(i))){
					sb.append(str.toLowerCase().charAt(i));
				}else{
					sb.append(str.toUpperCase().charAt(i));
				}
			}
			System.out.println(sb);
		}catch(Exception e){
			System.err.println(e);
		}
	}
} Main public static void main(String[] args){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		try{
			String str = br.readLine();
			for(int i=0;i<str.length();i++){
				if(Character.isUpperCase(str.charAt(i))){
					sb.append(str.toLowerCase().charAt(i));
				}else{
					sb.append(str.toUpperCase().charAt(i));
				}
			}
			System.out.println(sb);
		}catch(Exception e){
			System.err.println(e);
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		try{
			String str = br.readLine();
			for(int i=0;i<str.length();i++){
				if(Character.isUpperCase(str.charAt(i))){
					sb.append(str.toLowerCase().charAt(i));
				}else{
					sb.append(str.toUpperCase().charAt(i));
				}
			}
			System.out.println(sb);
		}catch(Exception e){
			System.err.println(e);
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() try{
			String str = br.readLine();
			for(int i=0;i<str.length();i++){
				if(Character.isUpperCase(str.charAt(i))){
					sb.append(str.toLowerCase().charAt(i));
				}else{
					sb.append(str.toUpperCase().charAt(i));
				}
			}
			System.out.println(sb);
		}catch(Exception e){
			System.err.println(e);
		} catch(Exception e){
			System.err.println(e);
		} Exception e {
			System.err.println(e);
		} System.err.println(e) System.err.println System.err System System.err e {
			String str = br.readLine();
			for(int i=0;i<str.length();i++){
				if(Character.isUpperCase(str.charAt(i))){
					sb.append(str.toLowerCase().charAt(i));
				}else{
					sb.append(str.toUpperCase().charAt(i));
				}
			}
			System.out.println(sb);
		} String str = br.readLine(); str br.readLine() br.readLine br for(int i=0;i<str.length();i++){
				if(Character.isUpperCase(str.charAt(i))){
					sb.append(str.toLowerCase().charAt(i));
				}else{
					sb.append(str.toUpperCase().charAt(i));
				}
			} 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.toLowerCase().charAt(i));
				}else{
					sb.append(str.toUpperCase().charAt(i));
				}
			} {
				if(Character.isUpperCase(str.charAt(i))){
					sb.append(str.toLowerCase().charAt(i));
				}else{
					sb.append(str.toUpperCase().charAt(i));
				}
			} if(Character.isUpperCase(str.charAt(i))){
					sb.append(str.toLowerCase().charAt(i));
				}else{
					sb.append(str.toUpperCase().charAt(i));
				} Character.isUpperCase(str.charAt(i)) Character.isUpperCase Character str.charAt(i) str.charAt str i {
					sb.append(str.toLowerCase().charAt(i));
				} sb.append(str.toLowerCase().charAt(i)) sb.append sb str.toLowerCase().charAt(i) str.toLowerCase().charAt str.toLowerCase() str.toLowerCase str i {
					sb.append(str.toUpperCase().charAt(i));
				} sb.append(str.toUpperCase().charAt(i)) sb.append sb str.toUpperCase().charAt(i) str.toUpperCase().charAt str.toUpperCase() str.toUpperCase str i System.out.println(sb) System.out.println System.out System System.out sb String[] args args public class Main {
	public static void main(String[] args){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		try{
			String str = br.readLine();
			for(int i=0;i<str.length();i++){
				if(Character.isUpperCase(str.charAt(i))){
					sb.append(str.toLowerCase().charAt(i));
				}else{
					sb.append(str.toUpperCase().charAt(i));
				}
			}
			System.out.println(sb);
		}catch(Exception e){
			System.err.println(e);
		}
	}
} public class Main {
	public static void main(String[] args){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		try{
			String str = br.readLine();
			for(int i=0;i<str.length();i++){
				if(Character.isUpperCase(str.charAt(i))){
					sb.append(str.toLowerCase().charAt(i));
				}else{
					sb.append(str.toUpperCase().charAt(i));
				}
			}
			System.out.println(sb);
		}catch(Exception e){
			System.err.println(e);
		}
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		try{
			String str = br.readLine();
			for(int i=0;i<str.length();i++){
				if(Character.isUpperCase(str.charAt(i))){
					sb.append(str.toLowerCase().charAt(i));
				}else{
					sb.append(str.toUpperCase().charAt(i));
				}
			}
			System.out.println(sb);
		}catch(Exception e){
			System.err.println(e);
		}
	}
}