import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

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

		String input = sc.nextLine();
		
		for(char c : input.toCharArray()){
			System.out.print(('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') ? (char) (c ^ ('a' - 'A'))  : c);
		}
		System.out.println();
	}

} import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util public class Main {
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);

		String input = sc.nextLine();
		
		for(char c : input.toCharArray()){
			System.out.print(('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') ? (char) (c ^ ('a' - 'A'))  : c);
		}
		System.out.println();
	}

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

		String input = sc.nextLine();
		
		for(char c : input.toCharArray()){
			System.out.print(('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') ? (char) (c ^ ('a' - 'A'))  : c);
		}
		System.out.println();
	} main {
		Scanner sc = new Scanner(System.in);

		String input = sc.nextLine();
		
		for(char c : input.toCharArray()){
			System.out.print(('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') ? (char) (c ^ ('a' - 'A'))  : c);
		}
		System.out.println();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input = sc.nextLine(); input sc.nextLine() sc.nextLine sc for(char c : input.toCharArray()){
			System.out.print(('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') ? (char) (c ^ ('a' - 'A'))  : c);
		} char c input.toCharArray() input.toCharArray input {
			System.out.print(('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') ? (char) (c ^ ('a' - 'A'))  : c);
		} {
			System.out.print(('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') ? (char) (c ^ ('a' - 'A'))  : c);
		} System.out.print(('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') ? (char) (c ^ ('a' - 'A'))  : c) System.out.print System.out System System.out ('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') ? (char) (c ^ ('a' - 'A'))  : c ('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') 'a' <= c && c <= 'z' 'a' <= c 'a' c c <= 'z' c 'z' 'A' <= c && c <= 'Z' 'A' <= c 'A' c c <= 'Z' c 'Z' (char) (c ^ ('a' - 'A')) c ('a' - 'A') 'a' 'A' c System.out.println() System.out.println System.out System System.out String args[] args public class Main {
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);

		String input = sc.nextLine();
		
		for(char c : input.toCharArray()){
			System.out.print(('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') ? (char) (c ^ ('a' - 'A'))  : c);
		}
		System.out.println();
	}

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

		String input = sc.nextLine();
		
		for(char c : input.toCharArray()){
			System.out.print(('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') ? (char) (c ^ ('a' - 'A'))  : c);
		}
		System.out.println();
	}

} Main
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

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

		String input = sc.nextLine();
		
		for(char c : input.toCharArray()){
			System.out.print(('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') ? (char) (c ^ ('a' - 'A'))  : c);
		}
		System.out.println();
	}

}