import 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();
		char[] chr = null;
		
		if(str != null && str.length() < 1200) {
			chr = str.toCharArray();
			for (int i = 0; i < chr.length; i++) {
				chr[i] = getReverseCase(chr[i]);
			}
		}
		
		System.out.println(String.valueOf(chr));
	}
	
	public static char getReverseCase(char c) {
		String str = String.valueOf(c);
		if (str.equals(str.toUpperCase())) return str.toLowerCase().toCharArray()[0];
		if (str.equals(str.toLowerCase())) return str.toUpperCase().toCharArray()[0];
		return c;
	}
} 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 str = br.readLine();
		char[] chr = null;
		
		if(str != null && str.length() < 1200) {
			chr = str.toCharArray();
			for (int i = 0; i < chr.length; i++) {
				chr[i] = getReverseCase(chr[i]);
			}
		}
		
		System.out.println(String.valueOf(chr));
	}
	
	public static char getReverseCase(char c) {
		String str = String.valueOf(c);
		if (str.equals(str.toUpperCase())) return str.toLowerCase().toCharArray()[0];
		if (str.equals(str.toLowerCase())) return str.toUpperCase().toCharArray()[0];
		return c;
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		char[] chr = null;
		
		if(str != null && str.length() < 1200) {
			chr = str.toCharArray();
			for (int i = 0; i < chr.length; i++) {
				chr[i] = getReverseCase(chr[i]);
			}
		}
		
		System.out.println(String.valueOf(chr));
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		char[] chr = null;
		
		if(str != null && str.length() < 1200) {
			chr = str.toCharArray();
			for (int i = 0; i < chr.length; i++) {
				chr[i] = getReverseCase(chr[i]);
			}
		}
		
		System.out.println(String.valueOf(chr));
	} 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 char[] chr = null; chr null if(str != null && str.length() < 1200) {
			chr = str.toCharArray();
			for (int i = 0; i < chr.length; i++) {
				chr[i] = getReverseCase(chr[i]);
			}
		} str != null && str.length() < 1200 str != null str null str.length() < 1200 str.length() str.length str 1200 {
			chr = str.toCharArray();
			for (int i = 0; i < chr.length; i++) {
				chr[i] = getReverseCase(chr[i]);
			}
		} chr = str.toCharArray() chr str.toCharArray() str.toCharArray str for (int i = 0; i < chr.length; i++) {
				chr[i] = getReverseCase(chr[i]);
			} int i = 0; int i = 0; i 0 i < chr.length i chr.length chr chr.length i++ i++ i {
				chr[i] = getReverseCase(chr[i]);
			} {
				chr[i] = getReverseCase(chr[i]);
			} chr[i] = getReverseCase(chr[i]) chr[i] chr i getReverseCase(chr[i]) getReverseCase chr[i] chr i System.out.println(String.valueOf(chr)) System.out.println System.out System System.out String.valueOf(chr) String.valueOf String chr String[] args args public static char getReverseCase(char c) {
		String str = String.valueOf(c);
		if (str.equals(str.toUpperCase())) return str.toLowerCase().toCharArray()[0];
		if (str.equals(str.toLowerCase())) return str.toUpperCase().toCharArray()[0];
		return c;
	} getReverseCase {
		String str = String.valueOf(c);
		if (str.equals(str.toUpperCase())) return str.toLowerCase().toCharArray()[0];
		if (str.equals(str.toLowerCase())) return str.toUpperCase().toCharArray()[0];
		return c;
	} String str = String.valueOf(c); str String.valueOf(c) String.valueOf String c if (str.equals(str.toUpperCase())) return str.toLowerCase().toCharArray()[0]; str.equals(str.toUpperCase()) str.equals str str.toUpperCase() str.toUpperCase str return str.toLowerCase().toCharArray()[0]; str.toLowerCase().toCharArray()[0] str.toLowerCase().toCharArray() str.toLowerCase().toCharArray str.toLowerCase() str.toLowerCase str 0 if (str.equals(str.toLowerCase())) return str.toUpperCase().toCharArray()[0]; str.equals(str.toLowerCase()) str.equals str str.toLowerCase() str.toLowerCase str return str.toUpperCase().toCharArray()[0]; str.toUpperCase().toCharArray()[0] str.toUpperCase().toCharArray() str.toUpperCase().toCharArray str.toUpperCase() str.toUpperCase str 0 return c; c char c c public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		char[] chr = null;
		
		if(str != null && str.length() < 1200) {
			chr = str.toCharArray();
			for (int i = 0; i < chr.length; i++) {
				chr[i] = getReverseCase(chr[i]);
			}
		}
		
		System.out.println(String.valueOf(chr));
	}
	
	public static char getReverseCase(char c) {
		String str = String.valueOf(c);
		if (str.equals(str.toUpperCase())) return str.toLowerCase().toCharArray()[0];
		if (str.equals(str.toLowerCase())) return str.toUpperCase().toCharArray()[0];
		return c;
	}
} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		char[] chr = null;
		
		if(str != null && str.length() < 1200) {
			chr = str.toCharArray();
			for (int i = 0; i < chr.length; i++) {
				chr[i] = getReverseCase(chr[i]);
			}
		}
		
		System.out.println(String.valueOf(chr));
	}
	
	public static char getReverseCase(char c) {
		String str = String.valueOf(c);
		if (str.equals(str.toUpperCase())) return str.toLowerCase().toCharArray()[0];
		if (str.equals(str.toLowerCase())) return str.toUpperCase().toCharArray()[0];
		return c;
	}
} Main
import 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();
		char[] chr = null;
		
		if(str != null && str.length() < 1200) {
			chr = str.toCharArray();
			for (int i = 0; i < chr.length; i++) {
				chr[i] = getReverseCase(chr[i]);
			}
		}
		
		System.out.println(String.valueOf(chr));
	}
	
	public static char getReverseCase(char c) {
		String str = String.valueOf(c);
		if (str.equals(str.toUpperCase())) return str.toLowerCase().toCharArray()[0];
		if (str.equals(str.toLowerCase())) return str.toUpperCase().toCharArray()[0];
		return c;
	}
}