import java.util.Scanner;


class Main {
  public static void main(String args[]) {
	  	Scanner scanner = new Scanner(System.in);
	  	String str = scanner.nextLine();			//入力
	  	String con[] =  new String[1200];
		int count = 0;
		
  		//初期化
  		for(int i = 0; i < 1200 ;i ++) {
	  		con[i] = "";
		}
			count = str.length();		//文字数取得
			
			//大文字小文字変換
			for(int i = 0; i < count ;i ++) {
			    if( Character.isUpperCase( str.charAt( i ) ) ) {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toLowerCase();
				}
		        else {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toUpperCase();
				}
			}
			
			//出力
			for(int i = 0; i < count ;i ++) {
				if(i == count - 1){
					System.out.println(con[i]);
				}else{
					System.out.print(con[i]);
				}
			}
		scanner.close();
  }
} import java.util.Scanner; Scanner java.util class Main {
  public static void main(String args[]) {
	  	Scanner scanner = new Scanner(System.in);
	  	String str = scanner.nextLine();			//入力
	  	String con[] =  new String[1200];
		int count = 0;
		
  		//初期化
  		for(int i = 0; i < 1200 ;i ++) {
	  		con[i] = "";
		}
			count = str.length();		//文字数取得
			
			//大文字小文字変換
			for(int i = 0; i < count ;i ++) {
			    if( Character.isUpperCase( str.charAt( i ) ) ) {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toLowerCase();
				}
		        else {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toUpperCase();
				}
			}
			
			//出力
			for(int i = 0; i < count ;i ++) {
				if(i == count - 1){
					System.out.println(con[i]);
				}else{
					System.out.print(con[i]);
				}
			}
		scanner.close();
  }
} Main public static void main(String args[]) {
	  	Scanner scanner = new Scanner(System.in);
	  	String str = scanner.nextLine();			//入力
	  	String con[] =  new String[1200];
		int count = 0;
		
  		//初期化
  		for(int i = 0; i < 1200 ;i ++) {
	  		con[i] = "";
		}
			count = str.length();		//文字数取得
			
			//大文字小文字変換
			for(int i = 0; i < count ;i ++) {
			    if( Character.isUpperCase( str.charAt( i ) ) ) {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toLowerCase();
				}
		        else {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toUpperCase();
				}
			}
			
			//出力
			for(int i = 0; i < count ;i ++) {
				if(i == count - 1){
					System.out.println(con[i]);
				}else{
					System.out.print(con[i]);
				}
			}
		scanner.close();
  } main {
	  	Scanner scanner = new Scanner(System.in);
	  	String str = scanner.nextLine();			//入力
	  	String con[] =  new String[1200];
		int count = 0;
		
  		//初期化
  		for(int i = 0; i < 1200 ;i ++) {
	  		con[i] = "";
		}
			count = str.length();		//文字数取得
			
			//大文字小文字変換
			for(int i = 0; i < count ;i ++) {
			    if( Character.isUpperCase( str.charAt( i ) ) ) {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toLowerCase();
				}
		        else {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toUpperCase();
				}
			}
			
			//出力
			for(int i = 0; i < count ;i ++) {
				if(i == count - 1){
					System.out.println(con[i]);
				}else{
					System.out.print(con[i]);
				}
			}
		scanner.close();
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String str = scanner.nextLine(); str scanner.nextLine() scanner.nextLine scanner String con[] =  new String[1200]; con new String[1200] 1200 int count = 0; count 0 for(int i = 0; i < 1200 ;i ++) {
	  		con[i] = "";
		} int i = 0; int i = 0; i 0 i < 1200 i 1200 i ++ i ++ i {
	  		con[i] = "";
		} {
	  		con[i] = "";
		} con[i] = "" con[i] con i "" count = str.length() count str.length() str.length str for(int i = 0; i < count ;i ++) {
			    if( Character.isUpperCase( str.charAt( i ) ) ) {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toLowerCase();
				}
		        else {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toUpperCase();
				}
			} int i = 0; int i = 0; i 0 i < count i count i ++ i ++ i {
			    if( Character.isUpperCase( str.charAt( i ) ) ) {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toLowerCase();
				}
		        else {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toUpperCase();
				}
			} {
			    if( Character.isUpperCase( str.charAt( i ) ) ) {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toLowerCase();
				}
		        else {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toUpperCase();
				}
			} if( Character.isUpperCase( str.charAt( i ) ) ) {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toLowerCase();
				}
		        else {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toUpperCase();
				} Character.isUpperCase( str.charAt( i ) ) Character.isUpperCase Character str.charAt( i ) str.charAt str i {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toLowerCase();
				} con[i] = str.substring(i,i + 1) con[i] con i str.substring(i,i + 1) str.substring str i i + 1 i 1 con[i] = con[i].toLowerCase() con[i] con i con[i].toLowerCase() con[i].toLowerCase con[i] con i {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toUpperCase();
				} con[i] = str.substring(i,i + 1) con[i] con i str.substring(i,i + 1) str.substring str i i + 1 i 1 con[i] = con[i].toUpperCase() con[i] con i con[i].toUpperCase() con[i].toUpperCase con[i] con i for(int i = 0; i < count ;i ++) {
				if(i == count - 1){
					System.out.println(con[i]);
				}else{
					System.out.print(con[i]);
				}
			} int i = 0; int i = 0; i 0 i < count i count i ++ i ++ i {
				if(i == count - 1){
					System.out.println(con[i]);
				}else{
					System.out.print(con[i]);
				}
			} {
				if(i == count - 1){
					System.out.println(con[i]);
				}else{
					System.out.print(con[i]);
				}
			} if(i == count - 1){
					System.out.println(con[i]);
				}else{
					System.out.print(con[i]);
				} i == count - 1 i count - 1 count 1 {
					System.out.println(con[i]);
				} System.out.println(con[i]) System.out.println System.out System System.out con[i] con i {
					System.out.print(con[i]);
				} System.out.print(con[i]) System.out.print System.out System System.out con[i] con i scanner.close() scanner.close scanner String args[] args
import java.util.Scanner;


class Main {
  public static void main(String args[]) {
	  	Scanner scanner = new Scanner(System.in);
	  	String str = scanner.nextLine();			//入力
	  	String con[] =  new String[1200];
		int count = 0;
		
  		//初期化
  		for(int i = 0; i < 1200 ;i ++) {
	  		con[i] = "";
		}
			count = str.length();		//文字数取得
			
			//大文字小文字変換
			for(int i = 0; i < count ;i ++) {
			    if( Character.isUpperCase( str.charAt( i ) ) ) {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toLowerCase();
				}
		        else {
		  			con[i] = str.substring(i,i + 1);
		  			con[i] = con[i].toUpperCase();
				}
			}
			
			//出力
			for(int i = 0; i < count ;i ++) {
				if(i == count - 1){
					System.out.println(con[i]);
				}else{
					System.out.print(con[i]);
				}
			}
		scanner.close();
  }
}
