import java.io.*;
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		try{
			Scanner stdIn = new Scanner(System.in);
			
			String s = stdIn.nextLine();
			
			int l = s.length();
			for(int i = 0;i < l;i++){
				if(Character.isUpperCase(s.charAt(i))){
					char a = s.charAt(i);
					a = Character.toLowerCase(a);
					System.out.print(a);
				}
				else {
					char a = s.charAt(i);
					a = Character.toUpperCase(a);
					System.out.print(a);
				}
			}
			System.out.println();
		} catch(Exception e){
		}
	}
}
			 import java.io.*; io.* java import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args){
		try{
			Scanner stdIn = new Scanner(System.in);
			
			String s = stdIn.nextLine();
			
			int l = s.length();
			for(int i = 0;i < l;i++){
				if(Character.isUpperCase(s.charAt(i))){
					char a = s.charAt(i);
					a = Character.toLowerCase(a);
					System.out.print(a);
				}
				else {
					char a = s.charAt(i);
					a = Character.toUpperCase(a);
					System.out.print(a);
				}
			}
			System.out.println();
		} catch(Exception e){
		}
	}
} Main public static void main(String[] args){
		try{
			Scanner stdIn = new Scanner(System.in);
			
			String s = stdIn.nextLine();
			
			int l = s.length();
			for(int i = 0;i < l;i++){
				if(Character.isUpperCase(s.charAt(i))){
					char a = s.charAt(i);
					a = Character.toLowerCase(a);
					System.out.print(a);
				}
				else {
					char a = s.charAt(i);
					a = Character.toUpperCase(a);
					System.out.print(a);
				}
			}
			System.out.println();
		} catch(Exception e){
		}
	} main {
		try{
			Scanner stdIn = new Scanner(System.in);
			
			String s = stdIn.nextLine();
			
			int l = s.length();
			for(int i = 0;i < l;i++){
				if(Character.isUpperCase(s.charAt(i))){
					char a = s.charAt(i);
					a = Character.toLowerCase(a);
					System.out.print(a);
				}
				else {
					char a = s.charAt(i);
					a = Character.toUpperCase(a);
					System.out.print(a);
				}
			}
			System.out.println();
		} catch(Exception e){
		}
	} try{
			Scanner stdIn = new Scanner(System.in);
			
			String s = stdIn.nextLine();
			
			int l = s.length();
			for(int i = 0;i < l;i++){
				if(Character.isUpperCase(s.charAt(i))){
					char a = s.charAt(i);
					a = Character.toLowerCase(a);
					System.out.print(a);
				}
				else {
					char a = s.charAt(i);
					a = Character.toUpperCase(a);
					System.out.print(a);
				}
			}
			System.out.println();
		} catch(Exception e){
		} catch(Exception e){
		} Exception e {
		} {
			Scanner stdIn = new Scanner(System.in);
			
			String s = stdIn.nextLine();
			
			int l = s.length();
			for(int i = 0;i < l;i++){
				if(Character.isUpperCase(s.charAt(i))){
					char a = s.charAt(i);
					a = Character.toLowerCase(a);
					System.out.print(a);
				}
				else {
					char a = s.charAt(i);
					a = Character.toUpperCase(a);
					System.out.print(a);
				}
			}
			System.out.println();
		} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) String s = stdIn.nextLine(); s stdIn.nextLine() stdIn.nextLine stdIn int l = s.length(); l s.length() s.length s for(int i = 0;i < l;i++){
				if(Character.isUpperCase(s.charAt(i))){
					char a = s.charAt(i);
					a = Character.toLowerCase(a);
					System.out.print(a);
				}
				else {
					char a = s.charAt(i);
					a = Character.toUpperCase(a);
					System.out.print(a);
				}
			} int i = 0; int i = 0; i 0 i < l i l i++ i++ i {
				if(Character.isUpperCase(s.charAt(i))){
					char a = s.charAt(i);
					a = Character.toLowerCase(a);
					System.out.print(a);
				}
				else {
					char a = s.charAt(i);
					a = Character.toUpperCase(a);
					System.out.print(a);
				}
			} {
				if(Character.isUpperCase(s.charAt(i))){
					char a = s.charAt(i);
					a = Character.toLowerCase(a);
					System.out.print(a);
				}
				else {
					char a = s.charAt(i);
					a = Character.toUpperCase(a);
					System.out.print(a);
				}
			} if(Character.isUpperCase(s.charAt(i))){
					char a = s.charAt(i);
					a = Character.toLowerCase(a);
					System.out.print(a);
				}
				else {
					char a = s.charAt(i);
					a = Character.toUpperCase(a);
					System.out.print(a);
				} Character.isUpperCase(s.charAt(i)) Character.isUpperCase Character s.charAt(i) s.charAt s i {
					char a = s.charAt(i);
					a = Character.toLowerCase(a);
					System.out.print(a);
				} char a = s.charAt(i); a s.charAt(i) s.charAt s i a = Character.toLowerCase(a) a Character.toLowerCase(a) Character.toLowerCase Character a System.out.print(a) System.out.print System.out System System.out a {
					char a = s.charAt(i);
					a = Character.toUpperCase(a);
					System.out.print(a);
				} char a = s.charAt(i); a s.charAt(i) s.charAt s i a = Character.toUpperCase(a) a Character.toUpperCase(a) Character.toUpperCase Character a System.out.print(a) System.out.print System.out System System.out a System.out.println() System.out.println System.out System System.out String[] args args
import java.io.*;
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		try{
			Scanner stdIn = new Scanner(System.in);
			
			String s = stdIn.nextLine();
			
			int l = s.length();
			for(int i = 0;i < l;i++){
				if(Character.isUpperCase(s.charAt(i))){
					char a = s.charAt(i);
					a = Character.toLowerCase(a);
					System.out.print(a);
				}
				else {
					char a = s.charAt(i);
					a = Character.toUpperCase(a);
					System.out.print(a);
				}
			}
			System.out.println();
		} catch(Exception e){
		}
	}
}
			