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

public class Main {
	public static void main(String[] args) throws Exception {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    String line = br.readLine();

	    StringBuilder sb = new StringBuilder();
	    for (int i = 0; i < line.length(); i++) {
	    	char c = line.charAt(i);
	    	String s = String.valueOf(c);

	    	String lowerStr = s.toLowerCase();
	    	if (lowerStr.equals(s)) {
	    		sb.append(s.toUpperCase());
	    	} else {
	    		sb.append(s.toLowerCase());
	    	}
	    }
	    System.out.println(sb.toString());
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws Exception {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    String line = br.readLine();

	    StringBuilder sb = new StringBuilder();
	    for (int i = 0; i < line.length(); i++) {
	    	char c = line.charAt(i);
	    	String s = String.valueOf(c);

	    	String lowerStr = s.toLowerCase();
	    	if (lowerStr.equals(s)) {
	    		sb.append(s.toUpperCase());
	    	} else {
	    		sb.append(s.toLowerCase());
	    	}
	    }
	    System.out.println(sb.toString());
	}
} Main public static void main(String[] args) throws Exception {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    String line = br.readLine();

	    StringBuilder sb = new StringBuilder();
	    for (int i = 0; i < line.length(); i++) {
	    	char c = line.charAt(i);
	    	String s = String.valueOf(c);

	    	String lowerStr = s.toLowerCase();
	    	if (lowerStr.equals(s)) {
	    		sb.append(s.toUpperCase());
	    	} else {
	    		sb.append(s.toLowerCase());
	    	}
	    }
	    System.out.println(sb.toString());
	} main {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    String line = br.readLine();

	    StringBuilder sb = new StringBuilder();
	    for (int i = 0; i < line.length(); i++) {
	    	char c = line.charAt(i);
	    	String s = String.valueOf(c);

	    	String lowerStr = s.toLowerCase();
	    	if (lowerStr.equals(s)) {
	    		sb.append(s.toUpperCase());
	    	} else {
	    		sb.append(s.toLowerCase());
	    	}
	    }
	    System.out.println(sb.toString());
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line = br.readLine(); line br.readLine() br.readLine br StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int i = 0; i < line.length(); i++) {
	    	char c = line.charAt(i);
	    	String s = String.valueOf(c);

	    	String lowerStr = s.toLowerCase();
	    	if (lowerStr.equals(s)) {
	    		sb.append(s.toUpperCase());
	    	} else {
	    		sb.append(s.toLowerCase());
	    	}
	    } int i = 0; int i = 0; i 0 i < line.length() i line.length() line.length line i++ i++ i {
	    	char c = line.charAt(i);
	    	String s = String.valueOf(c);

	    	String lowerStr = s.toLowerCase();
	    	if (lowerStr.equals(s)) {
	    		sb.append(s.toUpperCase());
	    	} else {
	    		sb.append(s.toLowerCase());
	    	}
	    } {
	    	char c = line.charAt(i);
	    	String s = String.valueOf(c);

	    	String lowerStr = s.toLowerCase();
	    	if (lowerStr.equals(s)) {
	    		sb.append(s.toUpperCase());
	    	} else {
	    		sb.append(s.toLowerCase());
	    	}
	    } char c = line.charAt(i); c line.charAt(i) line.charAt line i String s = String.valueOf(c); s String.valueOf(c) String.valueOf String c String lowerStr = s.toLowerCase(); lowerStr s.toLowerCase() s.toLowerCase s if (lowerStr.equals(s)) {
	    		sb.append(s.toUpperCase());
	    	} else {
	    		sb.append(s.toLowerCase());
	    	} lowerStr.equals(s) lowerStr.equals lowerStr s {
	    		sb.append(s.toUpperCase());
	    	} sb.append(s.toUpperCase()) sb.append sb s.toUpperCase() s.toUpperCase s {
	    		sb.append(s.toLowerCase());
	    	} sb.append(s.toLowerCase()) sb.append sb s.toLowerCase() s.toLowerCase s 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) throws Exception {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    String line = br.readLine();

	    StringBuilder sb = new StringBuilder();
	    for (int i = 0; i < line.length(); i++) {
	    	char c = line.charAt(i);
	    	String s = String.valueOf(c);

	    	String lowerStr = s.toLowerCase();
	    	if (lowerStr.equals(s)) {
	    		sb.append(s.toUpperCase());
	    	} else {
	    		sb.append(s.toLowerCase());
	    	}
	    }
	    System.out.println(sb.toString());
	}
} public class Main {
	public static void main(String[] args) throws Exception {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    String line = br.readLine();

	    StringBuilder sb = new StringBuilder();
	    for (int i = 0; i < line.length(); i++) {
	    	char c = line.charAt(i);
	    	String s = String.valueOf(c);

	    	String lowerStr = s.toLowerCase();
	    	if (lowerStr.equals(s)) {
	    		sb.append(s.toUpperCase());
	    	} else {
	    		sb.append(s.toLowerCase());
	    	}
	    }
	    System.out.println(sb.toString());
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    String line = br.readLine();

	    StringBuilder sb = new StringBuilder();
	    for (int i = 0; i < line.length(); i++) {
	    	char c = line.charAt(i);
	    	String s = String.valueOf(c);

	    	String lowerStr = s.toLowerCase();
	    	if (lowerStr.equals(s)) {
	    		sb.append(s.toUpperCase());
	    	} else {
	    		sb.append(s.toLowerCase());
	    	}
	    }
	    System.out.println(sb.toString());
	}
}