import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=stdIn.nextLine();
		String ans="";
		for(int i=0;i<s.length();i++){
			char tmp=s.charAt(i);
			if('A'<=tmp&&tmp<='Z')
				ans+=(char)(tmp-'A'+'a');
			else if('a'<=tmp&&tmp<='z')
				ans+=(char)(tmp-'a'+'A');
			else
				ans+=tmp;
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java import java.io.*; io.* java import java.lang.*; lang.* java import java.math.*; math.* java public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=stdIn.nextLine();
		String ans="";
		for(int i=0;i<s.length();i++){
			char tmp=s.charAt(i);
			if('A'<=tmp&&tmp<='Z')
				ans+=(char)(tmp-'A'+'a');
			else if('a'<=tmp&&tmp<='z')
				ans+=(char)(tmp-'a'+'A');
			else
				ans+=tmp;
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=stdIn.nextLine();
		String ans="";
		for(int i=0;i<s.length();i++){
			char tmp=s.charAt(i);
			if('A'<=tmp&&tmp<='Z')
				ans+=(char)(tmp-'A'+'a');
			else if('a'<=tmp&&tmp<='z')
				ans+=(char)(tmp-'a'+'A');
			else
				ans+=tmp;
		}
		System.out.println(ans);
	} main {
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=stdIn.nextLine();
		String ans="";
		for(int i=0;i<s.length();i++){
			char tmp=s.charAt(i);
			if('A'<=tmp&&tmp<='Z')
				ans+=(char)(tmp-'A'+'a');
			else if('a'<=tmp&&tmp<='z')
				ans+=(char)(tmp-'a'+'A');
			else
				ans+=tmp;
		}
		System.out.println(ans);
	} Scanner stdIn=new Scanner(System.in); stdIn new Scanner(System.in) BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String s=stdIn.nextLine(); s stdIn.nextLine() stdIn.nextLine stdIn String ans=""; ans "" for(int i=0;i<s.length();i++){
			char tmp=s.charAt(i);
			if('A'<=tmp&&tmp<='Z')
				ans+=(char)(tmp-'A'+'a');
			else if('a'<=tmp&&tmp<='z')
				ans+=(char)(tmp-'a'+'A');
			else
				ans+=tmp;
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			char tmp=s.charAt(i);
			if('A'<=tmp&&tmp<='Z')
				ans+=(char)(tmp-'A'+'a');
			else if('a'<=tmp&&tmp<='z')
				ans+=(char)(tmp-'a'+'A');
			else
				ans+=tmp;
		} {
			char tmp=s.charAt(i);
			if('A'<=tmp&&tmp<='Z')
				ans+=(char)(tmp-'A'+'a');
			else if('a'<=tmp&&tmp<='z')
				ans+=(char)(tmp-'a'+'A');
			else
				ans+=tmp;
		} char tmp=s.charAt(i); tmp s.charAt(i) s.charAt s i if('A'<=tmp&&tmp<='Z')
				ans+=(char)(tmp-'A'+'a');
			else if('a'<=tmp&&tmp<='z')
				ans+=(char)(tmp-'a'+'A');
			else
				ans+=tmp; 'A'<=tmp&&tmp<='Z' 'A'<=tmp 'A' tmp tmp<='Z' tmp 'Z' ans+=(char)(tmp-'A'+'a') ans (char)(tmp-'A'+'a') tmp-'A' tmp 'A' 'a' if('a'<=tmp&&tmp<='z')
				ans+=(char)(tmp-'a'+'A');
			else
				ans+=tmp; 'a'<=tmp&&tmp<='z' 'a'<=tmp 'a' tmp tmp<='z' tmp 'z' ans+=(char)(tmp-'a'+'A') ans (char)(tmp-'a'+'A') tmp-'a' tmp 'a' 'A' ans+=tmp ans tmp System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=stdIn.nextLine();
		String ans="";
		for(int i=0;i<s.length();i++){
			char tmp=s.charAt(i);
			if('A'<=tmp&&tmp<='Z')
				ans+=(char)(tmp-'A'+'a');
			else if('a'<=tmp&&tmp<='z')
				ans+=(char)(tmp-'a'+'A');
			else
				ans+=tmp;
		}
		System.out.println(ans);
	}
} public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=stdIn.nextLine();
		String ans="";
		for(int i=0;i<s.length();i++){
			char tmp=s.charAt(i);
			if('A'<=tmp&&tmp<='Z')
				ans+=(char)(tmp-'A'+'a');
			else if('a'<=tmp&&tmp<='z')
				ans+=(char)(tmp-'a'+'A');
			else
				ans+=tmp;
		}
		System.out.println(ans);
	}
} Main
import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=stdIn.nextLine();
		String ans="";
		for(int i=0;i<s.length();i++){
			char tmp=s.charAt(i);
			if('A'<=tmp&&tmp<='Z')
				ans+=(char)(tmp-'A'+'a');
			else if('a'<=tmp&&tmp<='z')
				ans+=(char)(tmp-'a'+'A');
			else
				ans+=tmp;
		}
		System.out.println(ans);
	}
}