import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();

		sc.close();

		for(int i=0; i<str.length(); i++) {
			if(Character.isUpperCase(str.charAt(i))) {
				System.out.print(str.split("")[i].toLowerCase());
			} else {
				System.out.print(str.split("")[i].toUpperCase());
			}
		}
		System.out.println("");

	}

}
 import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();

		sc.close();

		for(int i=0; i<str.length(); i++) {
			if(Character.isUpperCase(str.charAt(i))) {
				System.out.print(str.split("")[i].toLowerCase());
			} else {
				System.out.print(str.split("")[i].toUpperCase());
			}
		}
		System.out.println("");

	}

} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();

		sc.close();

		for(int i=0; i<str.length(); i++) {
			if(Character.isUpperCase(str.charAt(i))) {
				System.out.print(str.split("")[i].toLowerCase());
			} else {
				System.out.print(str.split("")[i].toUpperCase());
			}
		}
		System.out.println("");

	} main {

		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();

		sc.close();

		for(int i=0; i<str.length(); i++) {
			if(Character.isUpperCase(str.charAt(i))) {
				System.out.print(str.split("")[i].toLowerCase());
			} else {
				System.out.print(str.split("")[i].toUpperCase());
			}
		}
		System.out.println("");

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc sc.close() sc.close sc for(int i=0; i<str.length(); i++) {
			if(Character.isUpperCase(str.charAt(i))) {
				System.out.print(str.split("")[i].toLowerCase());
			} else {
				System.out.print(str.split("")[i].toUpperCase());
			}
		} 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))) {
				System.out.print(str.split("")[i].toLowerCase());
			} else {
				System.out.print(str.split("")[i].toUpperCase());
			}
		} {
			if(Character.isUpperCase(str.charAt(i))) {
				System.out.print(str.split("")[i].toLowerCase());
			} else {
				System.out.print(str.split("")[i].toUpperCase());
			}
		} if(Character.isUpperCase(str.charAt(i))) {
				System.out.print(str.split("")[i].toLowerCase());
			} else {
				System.out.print(str.split("")[i].toUpperCase());
			} Character.isUpperCase(str.charAt(i)) Character.isUpperCase Character str.charAt(i) str.charAt str i {
				System.out.print(str.split("")[i].toLowerCase());
			} System.out.print(str.split("")[i].toLowerCase()) System.out.print System.out System System.out str.split("")[i].toLowerCase() str.split("")[i].toLowerCase str.split("")[i] str.split("") str.split str "" i {
				System.out.print(str.split("")[i].toUpperCase());
			} System.out.print(str.split("")[i].toUpperCase()) System.out.print System.out System System.out str.split("")[i].toUpperCase() str.split("")[i].toUpperCase str.split("")[i] str.split("") str.split str "" i System.out.println("") System.out.println System.out System System.out "" String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();

		sc.close();

		for(int i=0; i<str.length(); i++) {
			if(Character.isUpperCase(str.charAt(i))) {
				System.out.print(str.split("")[i].toLowerCase());
			} else {
				System.out.print(str.split("")[i].toUpperCase());
			}
		}
		System.out.println("");

	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();

		sc.close();

		for(int i=0; i<str.length(); i++) {
			if(Character.isUpperCase(str.charAt(i))) {
				System.out.print(str.split("")[i].toLowerCase());
			} else {
				System.out.print(str.split("")[i].toUpperCase());
			}
		}
		System.out.println("");

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();

		sc.close();

		for(int i=0; i<str.length(); i++) {
			if(Character.isUpperCase(str.charAt(i))) {
				System.out.print(str.split("")[i].toLowerCase());
			} else {
				System.out.print(str.split("")[i].toUpperCase());
			}
		}
		System.out.println("");

	}

}

