import java.util.*;
class Main {
	public static void main (String[] args) throws java.lang.Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		for(int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if('a' <= c && c <= 'z') System.out.print((char)(c - 32));
			else if('A' <= c && c <= 'Z') System.out.print((char)(c + 32));
			else System.out.print(c);
		}
		System.out.println();
	}
} import java.util.*; util.* java class Main {
	public static void main (String[] args) throws java.lang.Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		for(int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if('a' <= c && c <= 'z') System.out.print((char)(c - 32));
			else if('A' <= c && c <= 'Z') System.out.print((char)(c + 32));
			else System.out.print(c);
		}
		System.out.println();
	}
} Main public static void main (String[] args) throws java.lang.Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		for(int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if('a' <= c && c <= 'z') System.out.print((char)(c - 32));
			else if('A' <= c && c <= 'Z') System.out.print((char)(c + 32));
			else System.out.print(c);
		}
		System.out.println();
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		for(int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if('a' <= c && c <= 'z') System.out.print((char)(c - 32));
			else if('A' <= c && c <= 'Z') System.out.print((char)(c + 32));
			else System.out.print(c);
		}
		System.out.println();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc for(int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if('a' <= c && c <= 'z') System.out.print((char)(c - 32));
			else if('A' <= c && c <= 'Z') System.out.print((char)(c + 32));
			else System.out.print(c);
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
			char c = s.charAt(i);
			if('a' <= c && c <= 'z') System.out.print((char)(c - 32));
			else if('A' <= c && c <= 'Z') System.out.print((char)(c + 32));
			else System.out.print(c);
		} {
			char c = s.charAt(i);
			if('a' <= c && c <= 'z') System.out.print((char)(c - 32));
			else if('A' <= c && c <= 'Z') System.out.print((char)(c + 32));
			else System.out.print(c);
		} char c = s.charAt(i); c s.charAt(i) s.charAt s i if('a' <= c && c <= 'z') System.out.print((char)(c - 32));
			else if('A' <= c && c <= 'Z') System.out.print((char)(c + 32));
			else System.out.print(c); 'a' <= c && c <= 'z' 'a' <= c 'a' c c <= 'z' c 'z' System.out.print((char)(c - 32)) System.out.print System.out System System.out (char)(c - 32) c 32 if('A' <= c && c <= 'Z') System.out.print((char)(c + 32));
			else System.out.print(c); 'A' <= c && c <= 'Z' 'A' <= c 'A' c c <= 'Z' c 'Z' System.out.print((char)(c + 32)) System.out.print System.out System System.out (char)(c + 32) c 32 System.out.print(c) System.out.print System.out System System.out c System.out.println() System.out.println System.out System System.out String[] args args
import java.util.*;
class Main {
	public static void main (String[] args) throws java.lang.Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		for(int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if('a' <= c && c <= 'z') System.out.print((char)(c - 32));
			else if('A' <= c && c <= 'Z') System.out.print((char)(c + 32));
			else System.out.print(c);
		}
		System.out.println();
	}
}