import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line=sc.nextLine();
		char [] s=new char[line.length()];
		for(int i=0; i<line.length(); i++){
			if(Character.isUpperCase(line.charAt(i))){
				s[i]=Character.toLowerCase(line.charAt(i));
			}else if(Character.isLowerCase(line.charAt(i))){
				s[i]=Character.toUpperCase(line.charAt(i));
			}else{
				s[i]=line.charAt(i);
			}
		}
		for(int j=0; j<s.length; j++){
			System.out.print(s[j]);
		}
		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 line=sc.nextLine();
		char [] s=new char[line.length()];
		for(int i=0; i<line.length(); i++){
			if(Character.isUpperCase(line.charAt(i))){
				s[i]=Character.toLowerCase(line.charAt(i));
			}else if(Character.isLowerCase(line.charAt(i))){
				s[i]=Character.toUpperCase(line.charAt(i));
			}else{
				s[i]=line.charAt(i);
			}
		}
		for(int j=0; j<s.length; j++){
			System.out.print(s[j]);
		}
		System.out.println();
		}


} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line=sc.nextLine();
		char [] s=new char[line.length()];
		for(int i=0; i<line.length(); i++){
			if(Character.isUpperCase(line.charAt(i))){
				s[i]=Character.toLowerCase(line.charAt(i));
			}else if(Character.isLowerCase(line.charAt(i))){
				s[i]=Character.toUpperCase(line.charAt(i));
			}else{
				s[i]=line.charAt(i);
			}
		}
		for(int j=0; j<s.length; j++){
			System.out.print(s[j]);
		}
		System.out.println();
		} main {
		Scanner sc = new Scanner(System.in);
		String line=sc.nextLine();
		char [] s=new char[line.length()];
		for(int i=0; i<line.length(); i++){
			if(Character.isUpperCase(line.charAt(i))){
				s[i]=Character.toLowerCase(line.charAt(i));
			}else if(Character.isLowerCase(line.charAt(i))){
				s[i]=Character.toUpperCase(line.charAt(i));
			}else{
				s[i]=line.charAt(i);
			}
		}
		for(int j=0; j<s.length; j++){
			System.out.print(s[j]);
		}
		System.out.println();
		} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line=sc.nextLine(); line sc.nextLine() sc.nextLine sc char [] s=new char[line.length()]; s new char[line.length()] line.length() line.length line for(int i=0; i<line.length(); i++){
			if(Character.isUpperCase(line.charAt(i))){
				s[i]=Character.toLowerCase(line.charAt(i));
			}else if(Character.isLowerCase(line.charAt(i))){
				s[i]=Character.toUpperCase(line.charAt(i));
			}else{
				s[i]=line.charAt(i);
			}
		} int i=0; int i=0; i 0 i<line.length() i line.length() line.length line i++ i++ i {
			if(Character.isUpperCase(line.charAt(i))){
				s[i]=Character.toLowerCase(line.charAt(i));
			}else if(Character.isLowerCase(line.charAt(i))){
				s[i]=Character.toUpperCase(line.charAt(i));
			}else{
				s[i]=line.charAt(i);
			}
		} {
			if(Character.isUpperCase(line.charAt(i))){
				s[i]=Character.toLowerCase(line.charAt(i));
			}else if(Character.isLowerCase(line.charAt(i))){
				s[i]=Character.toUpperCase(line.charAt(i));
			}else{
				s[i]=line.charAt(i);
			}
		} if(Character.isUpperCase(line.charAt(i))){
				s[i]=Character.toLowerCase(line.charAt(i));
			}else if(Character.isLowerCase(line.charAt(i))){
				s[i]=Character.toUpperCase(line.charAt(i));
			}else{
				s[i]=line.charAt(i);
			} Character.isUpperCase(line.charAt(i)) Character.isUpperCase Character line.charAt(i) line.charAt line i {
				s[i]=Character.toLowerCase(line.charAt(i));
			} s[i]=Character.toLowerCase(line.charAt(i)) s[i] s i Character.toLowerCase(line.charAt(i)) Character.toLowerCase Character line.charAt(i) line.charAt line i if(Character.isLowerCase(line.charAt(i))){
				s[i]=Character.toUpperCase(line.charAt(i));
			}else{
				s[i]=line.charAt(i);
			} Character.isLowerCase(line.charAt(i)) Character.isLowerCase Character line.charAt(i) line.charAt line i {
				s[i]=Character.toUpperCase(line.charAt(i));
			} s[i]=Character.toUpperCase(line.charAt(i)) s[i] s i Character.toUpperCase(line.charAt(i)) Character.toUpperCase Character line.charAt(i) line.charAt line i {
				s[i]=line.charAt(i);
			} s[i]=line.charAt(i) s[i] s i line.charAt(i) line.charAt line i for(int j=0; j<s.length; j++){
			System.out.print(s[j]);
		} int j=0; int j=0; j 0 j<s.length j s.length s s.length j++ j++ j {
			System.out.print(s[j]);
		} {
			System.out.print(s[j]);
		} System.out.print(s[j]) System.out.print System.out System System.out s[j] s j 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 line=sc.nextLine();
		char [] s=new char[line.length()];
		for(int i=0; i<line.length(); i++){
			if(Character.isUpperCase(line.charAt(i))){
				s[i]=Character.toLowerCase(line.charAt(i));
			}else if(Character.isLowerCase(line.charAt(i))){
				s[i]=Character.toUpperCase(line.charAt(i));
			}else{
				s[i]=line.charAt(i);
			}
		}
		for(int j=0; j<s.length; j++){
			System.out.print(s[j]);
		}
		System.out.println();
		}


} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line=sc.nextLine();
		char [] s=new char[line.length()];
		for(int i=0; i<line.length(); i++){
			if(Character.isUpperCase(line.charAt(i))){
				s[i]=Character.toLowerCase(line.charAt(i));
			}else if(Character.isLowerCase(line.charAt(i))){
				s[i]=Character.toUpperCase(line.charAt(i));
			}else{
				s[i]=line.charAt(i);
			}
		}
		for(int j=0; j<s.length; j++){
			System.out.print(s[j]);
		}
		System.out.println();
		}


} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line=sc.nextLine();
		char [] s=new char[line.length()];
		for(int i=0; i<line.length(); i++){
			if(Character.isUpperCase(line.charAt(i))){
				s[i]=Character.toLowerCase(line.charAt(i));
			}else if(Character.isLowerCase(line.charAt(i))){
				s[i]=Character.toUpperCase(line.charAt(i));
			}else{
				s[i]=line.charAt(i);
			}
		}
		for(int j=0; j<s.length; j++){
			System.out.print(s[j]);
		}
		System.out.println();
		}


}
