import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.ArrayList;
import java.lang.Character;

public class Main {

	public static void main(String[] args) 
	throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String data = TempReaderCall.getStdInRead(br);
		
		char[] cdata = data.toCharArray();
		
		for (int i=0; i<cdata.length; i++){
			if (Character.isLowerCase(cdata[i]))
					cdata[i] = Character.toUpperCase(cdata[i]);
			else if (Character.isUpperCase(cdata[i]))
				cdata[i] = Character.toLowerCase(cdata[i]);
		}
		
		System.out.println(new String(cdata));
	}

}

class TempReaderCall{
	
	static ArrayList<String> getStdInReadlines(BufferedReader br, int line) throws IOException {
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < line; i++)
			list.add(br.readLine());
		return list;
	}
	
	static String getStdInRead(BufferedReader br) throws IOException {
		return (br.readLine());
	}
	
	
	static int[] splitIntArrayFromString(String st) {
		String[] sts = st.split(" ");
		int[] data = new int[sts.length];
		
		for (int i=0;i<sts.length;i++){
			data[i] = Integer.parseInt(sts[i]);
		}
		
		return data;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io import java.util.ArrayList; ArrayList java.util import java.lang.Character; Character java.lang public class Main {

	public static void main(String[] args) 
	throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String data = TempReaderCall.getStdInRead(br);
		
		char[] cdata = data.toCharArray();
		
		for (int i=0; i<cdata.length; i++){
			if (Character.isLowerCase(cdata[i]))
					cdata[i] = Character.toUpperCase(cdata[i]);
			else if (Character.isUpperCase(cdata[i]))
				cdata[i] = Character.toLowerCase(cdata[i]);
		}
		
		System.out.println(new String(cdata));
	}

} Main public static void main(String[] args) 
	throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String data = TempReaderCall.getStdInRead(br);
		
		char[] cdata = data.toCharArray();
		
		for (int i=0; i<cdata.length; i++){
			if (Character.isLowerCase(cdata[i]))
					cdata[i] = Character.toUpperCase(cdata[i]);
			else if (Character.isUpperCase(cdata[i]))
				cdata[i] = Character.toLowerCase(cdata[i]);
		}
		
		System.out.println(new String(cdata));
	} main {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String data = TempReaderCall.getStdInRead(br);
		
		char[] cdata = data.toCharArray();
		
		for (int i=0; i<cdata.length; i++){
			if (Character.isLowerCase(cdata[i]))
					cdata[i] = Character.toUpperCase(cdata[i]);
			else if (Character.isUpperCase(cdata[i]))
				cdata[i] = Character.toLowerCase(cdata[i]);
		}
		
		System.out.println(new String(cdata));
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String data = TempReaderCall.getStdInRead(br); data TempReaderCall.getStdInRead(br) TempReaderCall.getStdInRead TempReaderCall br char[] cdata = data.toCharArray(); cdata data.toCharArray() data.toCharArray data for (int i=0; i<cdata.length; i++){
			if (Character.isLowerCase(cdata[i]))
					cdata[i] = Character.toUpperCase(cdata[i]);
			else if (Character.isUpperCase(cdata[i]))
				cdata[i] = Character.toLowerCase(cdata[i]);
		} int i=0; int i=0; i 0 i<cdata.length i cdata.length cdata cdata.length i++ i++ i {
			if (Character.isLowerCase(cdata[i]))
					cdata[i] = Character.toUpperCase(cdata[i]);
			else if (Character.isUpperCase(cdata[i]))
				cdata[i] = Character.toLowerCase(cdata[i]);
		} {
			if (Character.isLowerCase(cdata[i]))
					cdata[i] = Character.toUpperCase(cdata[i]);
			else if (Character.isUpperCase(cdata[i]))
				cdata[i] = Character.toLowerCase(cdata[i]);
		} if (Character.isLowerCase(cdata[i]))
					cdata[i] = Character.toUpperCase(cdata[i]);
			else if (Character.isUpperCase(cdata[i]))
				cdata[i] = Character.toLowerCase(cdata[i]); Character.isLowerCase(cdata[i]) Character.isLowerCase Character cdata[i] cdata i cdata[i] = Character.toUpperCase(cdata[i]) cdata[i] cdata i Character.toUpperCase(cdata[i]) Character.toUpperCase Character cdata[i] cdata i if (Character.isUpperCase(cdata[i]))
				cdata[i] = Character.toLowerCase(cdata[i]); Character.isUpperCase(cdata[i]) Character.isUpperCase Character cdata[i] cdata i cdata[i] = Character.toLowerCase(cdata[i]) cdata[i] cdata i Character.toLowerCase(cdata[i]) Character.toLowerCase Character cdata[i] cdata i System.out.println(new String(cdata)) System.out.println System.out System System.out new String(cdata) String[] args args class TempReaderCall{
	
	static ArrayList<String> getStdInReadlines(BufferedReader br, int line) throws IOException {
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < line; i++)
			list.add(br.readLine());
		return list;
	}
	
	static String getStdInRead(BufferedReader br) throws IOException {
		return (br.readLine());
	}
	
	
	static int[] splitIntArrayFromString(String st) {
		String[] sts = st.split(" ");
		int[] data = new int[sts.length];
		
		for (int i=0;i<sts.length;i++){
			data[i] = Integer.parseInt(sts[i]);
		}
		
		return data;
	}
} TempReaderCall static ArrayList<String> getStdInReadlines(BufferedReader br, int line) throws IOException {
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < line; i++)
			list.add(br.readLine());
		return list;
	} getStdInReadlines {
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < line; i++)
			list.add(br.readLine());
		return list;
	} ArrayList<String> list = new ArrayList<String>(); list new ArrayList<String>() for (int i = 0; i < line; i++)
			list.add(br.readLine()); int i = 0; int i = 0; i 0 i < line i line i++ i++ i list.add(br.readLine()); list.add(br.readLine()) list.add list br.readLine() br.readLine br return list; list BufferedReader br br int line line static String getStdInRead(BufferedReader br) throws IOException {
		return (br.readLine());
	} getStdInRead {
		return (br.readLine());
	} return (br.readLine()); (br.readLine()) br.readLine br BufferedReader br br static int[] splitIntArrayFromString(String st) {
		String[] sts = st.split(" ");
		int[] data = new int[sts.length];
		
		for (int i=0;i<sts.length;i++){
			data[i] = Integer.parseInt(sts[i]);
		}
		
		return data;
	} splitIntArrayFromString {
		String[] sts = st.split(" ");
		int[] data = new int[sts.length];
		
		for (int i=0;i<sts.length;i++){
			data[i] = Integer.parseInt(sts[i]);
		}
		
		return data;
	} String[] sts = st.split(" "); sts st.split(" ") st.split st " " int[] data = new int[sts.length]; data new int[sts.length] sts.length sts sts.length for (int i=0;i<sts.length;i++){
			data[i] = Integer.parseInt(sts[i]);
		} int i=0; int i=0; i 0 i<sts.length i sts.length sts sts.length i++ i++ i {
			data[i] = Integer.parseInt(sts[i]);
		} {
			data[i] = Integer.parseInt(sts[i]);
		} data[i] = Integer.parseInt(sts[i]) data[i] data i Integer.parseInt(sts[i]) Integer.parseInt Integer sts[i] sts i return data; data String st st public class Main {

	public static void main(String[] args) 
	throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String data = TempReaderCall.getStdInRead(br);
		
		char[] cdata = data.toCharArray();
		
		for (int i=0; i<cdata.length; i++){
			if (Character.isLowerCase(cdata[i]))
					cdata[i] = Character.toUpperCase(cdata[i]);
			else if (Character.isUpperCase(cdata[i]))
				cdata[i] = Character.toLowerCase(cdata[i]);
		}
		
		System.out.println(new String(cdata));
	}

} public class Main {

	public static void main(String[] args) 
	throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String data = TempReaderCall.getStdInRead(br);
		
		char[] cdata = data.toCharArray();
		
		for (int i=0; i<cdata.length; i++){
			if (Character.isLowerCase(cdata[i]))
					cdata[i] = Character.toUpperCase(cdata[i]);
			else if (Character.isUpperCase(cdata[i]))
				cdata[i] = Character.toLowerCase(cdata[i]);
		}
		
		System.out.println(new String(cdata));
	}

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.ArrayList;
import java.lang.Character;

public class Main {

	public static void main(String[] args) 
	throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String data = TempReaderCall.getStdInRead(br);
		
		char[] cdata = data.toCharArray();
		
		for (int i=0; i<cdata.length; i++){
			if (Character.isLowerCase(cdata[i]))
					cdata[i] = Character.toUpperCase(cdata[i]);
			else if (Character.isUpperCase(cdata[i]))
				cdata[i] = Character.toLowerCase(cdata[i]);
		}
		
		System.out.println(new String(cdata));
	}

}

class TempReaderCall{
	
	static ArrayList<String> getStdInReadlines(BufferedReader br, int line) throws IOException {
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < line; i++)
			list.add(br.readLine());
		return list;
	}
	
	static String getStdInRead(BufferedReader br) throws IOException {
		return (br.readLine());
	}
	
	
	static int[] splitIntArrayFromString(String st) {
		String[] sts = st.split(" ");
		int[] data = new int[sts.length];
		
		for (int i=0;i<sts.length;i++){
			data[i] = Integer.parseInt(sts[i]);
		}
		
		return data;
	}
}