import java.io.*;
import java.util.*;
import java.lang.*;
import java.lang.Math;

class Main{
  public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    StringBuilder str=new StringBuilder(scan.nextLine());

    char[] output=new char[str.length()];
    str.getChars(0,str.length(),output,0);

    for(int i=0;i<output.length;i++){
      if(!Character.isUpperCase( output[i] ) ){
        output[i]=Character.toUpperCase(output[i]);
      }else if(!Character.isLowerCase(output[i])){
        output[i]=Character.toLowerCase(output[i]);
      }
    }

    //outputを文字列にする
    String ans=new String(output);
    System.out.println(ans);
  }
} import java.io.*; io.* java import java.util.*; util.* java import java.lang.*; lang.* java import java.lang.Math; Math java.lang class Main{
  public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    StringBuilder str=new StringBuilder(scan.nextLine());

    char[] output=new char[str.length()];
    str.getChars(0,str.length(),output,0);

    for(int i=0;i<output.length;i++){
      if(!Character.isUpperCase( output[i] ) ){
        output[i]=Character.toUpperCase(output[i]);
      }else if(!Character.isLowerCase(output[i])){
        output[i]=Character.toLowerCase(output[i]);
      }
    }

    //outputを文字列にする
    String ans=new String(output);
    System.out.println(ans);
  }
} Main public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    StringBuilder str=new StringBuilder(scan.nextLine());

    char[] output=new char[str.length()];
    str.getChars(0,str.length(),output,0);

    for(int i=0;i<output.length;i++){
      if(!Character.isUpperCase( output[i] ) ){
        output[i]=Character.toUpperCase(output[i]);
      }else if(!Character.isLowerCase(output[i])){
        output[i]=Character.toLowerCase(output[i]);
      }
    }

    //outputを文字列にする
    String ans=new String(output);
    System.out.println(ans);
  } main {
    Scanner scan=new Scanner(System.in);
    StringBuilder str=new StringBuilder(scan.nextLine());

    char[] output=new char[str.length()];
    str.getChars(0,str.length(),output,0);

    for(int i=0;i<output.length;i++){
      if(!Character.isUpperCase( output[i] ) ){
        output[i]=Character.toUpperCase(output[i]);
      }else if(!Character.isLowerCase(output[i])){
        output[i]=Character.toLowerCase(output[i]);
      }
    }

    //outputを文字列にする
    String ans=new String(output);
    System.out.println(ans);
  } Scanner scan=new Scanner(System.in); scan new Scanner(System.in) StringBuilder str=new StringBuilder(scan.nextLine()); str new StringBuilder(scan.nextLine()) char[] output=new char[str.length()]; output new char[str.length()] str.length() str.length str str.getChars(0,str.length(),output,0) str.getChars str 0 str.length() str.length str output 0 for(int i=0;i<output.length;i++){
      if(!Character.isUpperCase( output[i] ) ){
        output[i]=Character.toUpperCase(output[i]);
      }else if(!Character.isLowerCase(output[i])){
        output[i]=Character.toLowerCase(output[i]);
      }
    } int i=0; int i=0; i 0 i<output.length i output.length output output.length i++ i++ i {
      if(!Character.isUpperCase( output[i] ) ){
        output[i]=Character.toUpperCase(output[i]);
      }else if(!Character.isLowerCase(output[i])){
        output[i]=Character.toLowerCase(output[i]);
      }
    } {
      if(!Character.isUpperCase( output[i] ) ){
        output[i]=Character.toUpperCase(output[i]);
      }else if(!Character.isLowerCase(output[i])){
        output[i]=Character.toLowerCase(output[i]);
      }
    } if(!Character.isUpperCase( output[i] ) ){
        output[i]=Character.toUpperCase(output[i]);
      }else if(!Character.isLowerCase(output[i])){
        output[i]=Character.toLowerCase(output[i]);
      } !Character.isUpperCase( output[i] ) Character.isUpperCase( output[i] ) Character.isUpperCase Character output[i] output i {
        output[i]=Character.toUpperCase(output[i]);
      } output[i]=Character.toUpperCase(output[i]) output[i] output i Character.toUpperCase(output[i]) Character.toUpperCase Character output[i] output i if(!Character.isLowerCase(output[i])){
        output[i]=Character.toLowerCase(output[i]);
      } !Character.isLowerCase(output[i]) Character.isLowerCase(output[i]) Character.isLowerCase Character output[i] output i {
        output[i]=Character.toLowerCase(output[i]);
      } output[i]=Character.toLowerCase(output[i]) output[i] output i Character.toLowerCase(output[i]) Character.toLowerCase Character output[i] output i String ans=new String(output); ans new String(output) System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.io.*;
import java.util.*;
import java.lang.*;
import java.lang.Math;

class Main{
  public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    StringBuilder str=new StringBuilder(scan.nextLine());

    char[] output=new char[str.length()];
    str.getChars(0,str.length(),output,0);

    for(int i=0;i<output.length;i++){
      if(!Character.isUpperCase( output[i] ) ){
        output[i]=Character.toUpperCase(output[i]);
      }else if(!Character.isLowerCase(output[i])){
        output[i]=Character.toLowerCase(output[i]);
      }
    }

    //outputを文字列にする
    String ans=new String(output);
    System.out.println(ans);
  }
}
