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

public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {

			String str = br.readLine();

			StringBuilder sb = new StringBuilder();
			for(char c : str.toCharArray()){
				if(Character.isUpperCase(c)){
					sb.append(Character.toLowerCase(c));
				}else if(Character.isLowerCase(c)){
					sb.append(Character.toUpperCase(c));
				}else{
					sb.append(c);
				}
			}
			System.out.println(sb.toString());

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		}
	}
} 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) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {

			String str = br.readLine();

			StringBuilder sb = new StringBuilder();
			for(char c : str.toCharArray()){
				if(Character.isUpperCase(c)){
					sb.append(Character.toLowerCase(c));
				}else if(Character.isLowerCase(c)){
					sb.append(Character.toUpperCase(c));
				}else{
					sb.append(c);
				}
			}
			System.out.println(sb.toString());

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		}
	}
} Main public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {

			String str = br.readLine();

			StringBuilder sb = new StringBuilder();
			for(char c : str.toCharArray()){
				if(Character.isUpperCase(c)){
					sb.append(Character.toLowerCase(c));
				}else if(Character.isLowerCase(c)){
					sb.append(Character.toUpperCase(c));
				}else{
					sb.append(c);
				}
			}
			System.out.println(sb.toString());

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {

			String str = br.readLine();

			StringBuilder sb = new StringBuilder();
			for(char c : str.toCharArray()){
				if(Character.isUpperCase(c)){
					sb.append(Character.toLowerCase(c));
				}else if(Character.isLowerCase(c)){
					sb.append(Character.toUpperCase(c));
				}else{
					sb.append(c);
				}
			}
			System.out.println(sb.toString());

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) try {

			String str = br.readLine();

			StringBuilder sb = new StringBuilder();
			for(char c : str.toCharArray()){
				if(Character.isUpperCase(c)){
					sb.append(Character.toLowerCase(c));
				}else if(Character.isLowerCase(c)){
					sb.append(Character.toUpperCase(c));
				}else{
					sb.append(c);
				}
			}
			System.out.println(sb.toString());

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		} try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			} catch (IOException ioe) {
			} IOException ioe {
			} {
				if (br != null) {
					br.close();
				}
			} if (br != null) {
					br.close();
				} br != null br null {
					br.close();
				} br.close() br.close br {

			String str = br.readLine();

			StringBuilder sb = new StringBuilder();
			for(char c : str.toCharArray()){
				if(Character.isUpperCase(c)){
					sb.append(Character.toLowerCase(c));
				}else if(Character.isLowerCase(c)){
					sb.append(Character.toUpperCase(c));
				}else{
					sb.append(c);
				}
			}
			System.out.println(sb.toString());

		} String str = br.readLine(); str br.readLine() br.readLine br StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(char c : str.toCharArray()){
				if(Character.isUpperCase(c)){
					sb.append(Character.toLowerCase(c));
				}else if(Character.isLowerCase(c)){
					sb.append(Character.toUpperCase(c));
				}else{
					sb.append(c);
				}
			} char c str.toCharArray() str.toCharArray str {
				if(Character.isUpperCase(c)){
					sb.append(Character.toLowerCase(c));
				}else if(Character.isLowerCase(c)){
					sb.append(Character.toUpperCase(c));
				}else{
					sb.append(c);
				}
			} {
				if(Character.isUpperCase(c)){
					sb.append(Character.toLowerCase(c));
				}else if(Character.isLowerCase(c)){
					sb.append(Character.toUpperCase(c));
				}else{
					sb.append(c);
				}
			} if(Character.isUpperCase(c)){
					sb.append(Character.toLowerCase(c));
				}else if(Character.isLowerCase(c)){
					sb.append(Character.toUpperCase(c));
				}else{
					sb.append(c);
				} Character.isUpperCase(c) Character.isUpperCase Character c {
					sb.append(Character.toLowerCase(c));
				} sb.append(Character.toLowerCase(c)) sb.append sb Character.toLowerCase(c) Character.toLowerCase Character c if(Character.isLowerCase(c)){
					sb.append(Character.toUpperCase(c));
				}else{
					sb.append(c);
				} Character.isLowerCase(c) Character.isLowerCase Character c {
					sb.append(Character.toUpperCase(c));
				} sb.append(Character.toUpperCase(c)) sb.append sb Character.toUpperCase(c) Character.toUpperCase Character c {
					sb.append(c);
				} sb.append(c) sb.append sb c System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb String[] args args public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {

			String str = br.readLine();

			StringBuilder sb = new StringBuilder();
			for(char c : str.toCharArray()){
				if(Character.isUpperCase(c)){
					sb.append(Character.toLowerCase(c));
				}else if(Character.isLowerCase(c)){
					sb.append(Character.toUpperCase(c));
				}else{
					sb.append(c);
				}
			}
			System.out.println(sb.toString());

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		}
	}
} public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {

			String str = br.readLine();

			StringBuilder sb = new StringBuilder();
			for(char c : str.toCharArray()){
				if(Character.isUpperCase(c)){
					sb.append(Character.toLowerCase(c));
				}else if(Character.isLowerCase(c)){
					sb.append(Character.toUpperCase(c));
				}else{
					sb.append(c);
				}
			}
			System.out.println(sb.toString());

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		}
	}
} Main

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

public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {

			String str = br.readLine();

			StringBuilder sb = new StringBuilder();
			for(char c : str.toCharArray()){
				if(Character.isUpperCase(c)){
					sb.append(Character.toLowerCase(c));
				}else if(Character.isLowerCase(c)){
					sb.append(Character.toUpperCase(c));
				}else{
					sb.append(c);
				}
			}
			System.out.println(sb.toString());

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		}
	}
}