import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 

		StringBuffer line = new StringBuffer(sc.nextLine());
		for (int i = 0; i < line.length(); i++) {
			char ch = line.charAt(i);
			if (ch >= 'a' && ch <= 'z') {
				ch += 'A' - 'a';
				line.setCharAt(i, ch);
			} else if (ch >= 'A' && ch <= 'Z') {
				ch -= 'A' - 'a';
				line.setCharAt(i, ch);
			}
		}
		
		System.out.println(line);
		
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 

		StringBuffer line = new StringBuffer(sc.nextLine());
		for (int i = 0; i < line.length(); i++) {
			char ch = line.charAt(i);
			if (ch >= 'a' && ch <= 'z') {
				ch += 'A' - 'a';
				line.setCharAt(i, ch);
			} else if (ch >= 'A' && ch <= 'Z') {
				ch -= 'A' - 'a';
				line.setCharAt(i, ch);
			}
		}
		
		System.out.println(line);
		
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 

		StringBuffer line = new StringBuffer(sc.nextLine());
		for (int i = 0; i < line.length(); i++) {
			char ch = line.charAt(i);
			if (ch >= 'a' && ch <= 'z') {
				ch += 'A' - 'a';
				line.setCharAt(i, ch);
			} else if (ch >= 'A' && ch <= 'Z') {
				ch -= 'A' - 'a';
				line.setCharAt(i, ch);
			}
		}
		
		System.out.println(line);
		
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in); 

		StringBuffer line = new StringBuffer(sc.nextLine());
		for (int i = 0; i < line.length(); i++) {
			char ch = line.charAt(i);
			if (ch >= 'a' && ch <= 'z') {
				ch += 'A' - 'a';
				line.setCharAt(i, ch);
			} else if (ch >= 'A' && ch <= 'Z') {
				ch -= 'A' - 'a';
				line.setCharAt(i, ch);
			}
		}
		
		System.out.println(line);
		
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuffer line = new StringBuffer(sc.nextLine()); line new StringBuffer(sc.nextLine()) for (int i = 0; i < line.length(); i++) {
			char ch = line.charAt(i);
			if (ch >= 'a' && ch <= 'z') {
				ch += 'A' - 'a';
				line.setCharAt(i, ch);
			} else if (ch >= 'A' && ch <= 'Z') {
				ch -= 'A' - 'a';
				line.setCharAt(i, ch);
			}
		} int i = 0; int i = 0; i 0 i < line.length() i line.length() line.length line i++ i++ i {
			char ch = line.charAt(i);
			if (ch >= 'a' && ch <= 'z') {
				ch += 'A' - 'a';
				line.setCharAt(i, ch);
			} else if (ch >= 'A' && ch <= 'Z') {
				ch -= 'A' - 'a';
				line.setCharAt(i, ch);
			}
		} {
			char ch = line.charAt(i);
			if (ch >= 'a' && ch <= 'z') {
				ch += 'A' - 'a';
				line.setCharAt(i, ch);
			} else if (ch >= 'A' && ch <= 'Z') {
				ch -= 'A' - 'a';
				line.setCharAt(i, ch);
			}
		} char ch = line.charAt(i); ch line.charAt(i) line.charAt line i if (ch >= 'a' && ch <= 'z') {
				ch += 'A' - 'a';
				line.setCharAt(i, ch);
			} else if (ch >= 'A' && ch <= 'Z') {
				ch -= 'A' - 'a';
				line.setCharAt(i, ch);
			} ch >= 'a' && ch <= 'z' ch >= 'a' ch 'a' ch <= 'z' ch 'z' {
				ch += 'A' - 'a';
				line.setCharAt(i, ch);
			} ch += 'A' - 'a' ch 'A' - 'a' 'A' 'a' line.setCharAt(i, ch) line.setCharAt line i ch if (ch >= 'A' && ch <= 'Z') {
				ch -= 'A' - 'a';
				line.setCharAt(i, ch);
			} ch >= 'A' && ch <= 'Z' ch >= 'A' ch 'A' ch <= 'Z' ch 'Z' {
				ch -= 'A' - 'a';
				line.setCharAt(i, ch);
			} ch -= 'A' - 'a' ch 'A' - 'a' 'A' 'a' line.setCharAt(i, ch) line.setCharAt line i ch System.out.println(line) System.out.println System.out System System.out line sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 

		StringBuffer line = new StringBuffer(sc.nextLine());
		for (int i = 0; i < line.length(); i++) {
			char ch = line.charAt(i);
			if (ch >= 'a' && ch <= 'z') {
				ch += 'A' - 'a';
				line.setCharAt(i, ch);
			} else if (ch >= 'A' && ch <= 'Z') {
				ch -= 'A' - 'a';
				line.setCharAt(i, ch);
			}
		}
		
		System.out.println(line);
		
		sc.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 

		StringBuffer line = new StringBuffer(sc.nextLine());
		for (int i = 0; i < line.length(); i++) {
			char ch = line.charAt(i);
			if (ch >= 'a' && ch <= 'z') {
				ch += 'A' - 'a';
				line.setCharAt(i, ch);
			} else if (ch >= 'A' && ch <= 'Z') {
				ch -= 'A' - 'a';
				line.setCharAt(i, ch);
			}
		}
		
		System.out.println(line);
		
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 

		StringBuffer line = new StringBuffer(sc.nextLine());
		for (int i = 0; i < line.length(); i++) {
			char ch = line.charAt(i);
			if (ch >= 'a' && ch <= 'z') {
				ch += 'A' - 'a';
				line.setCharAt(i, ch);
			} else if (ch >= 'A' && ch <= 'Z') {
				ch -= 'A' - 'a';
				line.setCharAt(i, ch);
			}
		}
		
		System.out.println(line);
		
		sc.close();
	}
}