import java.util.Scanner;

public class Main{

	static Scanner s=new Scanner(System.in);

	public static void main(String __[]){
		input();
		solve();
	}

	private static void input(){
	}

	private static void solve(){
		char c[] = s.nextLine().toCharArray();
		for(int i=0;i<c.length;i++)
			c[i]=c[i]<='Z'
			?Character.toLowerCase(c[i])
			:Character.toUpperCase(c[i]);
		System.out.println(String.valueOf(c));
	}
} import java.util.Scanner; Scanner java.util public class Main{

	static Scanner s=new Scanner(System.in);

	public static void main(String __[]){
		input();
		solve();
	}

	private static void input(){
	}

	private static void solve(){
		char c[] = s.nextLine().toCharArray();
		for(int i=0;i<c.length;i++)
			c[i]=c[i]<='Z'
			?Character.toLowerCase(c[i])
			:Character.toUpperCase(c[i]);
		System.out.println(String.valueOf(c));
	}
} Main static Scanner s=new Scanner(System.in); s new Scanner(System.in) public static void main(String __[]){
		input();
		solve();
	} main {
		input();
		solve();
	} input() input solve() solve String __[] __ private static void input(){
	} input {
	} private static void solve(){
		char c[] = s.nextLine().toCharArray();
		for(int i=0;i<c.length;i++)
			c[i]=c[i]<='Z'
			?Character.toLowerCase(c[i])
			:Character.toUpperCase(c[i]);
		System.out.println(String.valueOf(c));
	} solve {
		char c[] = s.nextLine().toCharArray();
		for(int i=0;i<c.length;i++)
			c[i]=c[i]<='Z'
			?Character.toLowerCase(c[i])
			:Character.toUpperCase(c[i]);
		System.out.println(String.valueOf(c));
	} char c[] = s.nextLine().toCharArray(); c s.nextLine().toCharArray() s.nextLine().toCharArray s.nextLine() s.nextLine s for(int i=0;i<c.length;i++)
			c[i]=c[i]<='Z'
			?Character.toLowerCase(c[i])
			:Character.toUpperCase(c[i]); int i=0; int i=0; i 0 i<c.length i c.length c c.length i++ i++ i c[i]=c[i]<='Z'
			?Character.toLowerCase(c[i])
			:Character.toUpperCase(c[i]); c[i]=c[i]<='Z'
			?Character.toLowerCase(c[i])
			:Character.toUpperCase(c[i]) c[i] c i c[i]<='Z'
			?Character.toLowerCase(c[i])
			:Character.toUpperCase(c[i]) c[i]<='Z' c[i] c i 'Z' Character.toLowerCase(c[i]) Character.toLowerCase Character c[i] c i Character.toUpperCase(c[i]) Character.toUpperCase Character c[i] c i System.out.println(String.valueOf(c)) System.out.println System.out System System.out String.valueOf(c) String.valueOf String c public class Main{

	static Scanner s=new Scanner(System.in);

	public static void main(String __[]){
		input();
		solve();
	}

	private static void input(){
	}

	private static void solve(){
		char c[] = s.nextLine().toCharArray();
		for(int i=0;i<c.length;i++)
			c[i]=c[i]<='Z'
			?Character.toLowerCase(c[i])
			:Character.toUpperCase(c[i]);
		System.out.println(String.valueOf(c));
	}
} public class Main{

	static Scanner s=new Scanner(System.in);

	public static void main(String __[]){
		input();
		solve();
	}

	private static void input(){
	}

	private static void solve(){
		char c[] = s.nextLine().toCharArray();
		for(int i=0;i<c.length;i++)
			c[i]=c[i]<='Z'
			?Character.toLowerCase(c[i])
			:Character.toUpperCase(c[i]);
		System.out.println(String.valueOf(c));
	}
} Main
import java.util.Scanner;

public class Main{

	static Scanner s=new Scanner(System.in);

	public static void main(String __[]){
		input();
		solve();
	}

	private static void input(){
	}

	private static void solve(){
		char c[] = s.nextLine().toCharArray();
		for(int i=0;i<c.length;i++)
			c[i]=c[i]<='Z'
			?Character.toLowerCase(c[i])
			:Character.toUpperCase(c[i]);
		System.out.println(String.valueOf(c));
	}
}