import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws IOException {
    
    try( BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      String line = br.readLine();
      StringBuffer str = new StringBuffer(line.length());
      String s;

      for(int i = 0;i < line.length();i++) {
        s = line.substring(i,i+1);
        if( Character.isUpperCase(s.charAt(0)) )
          str.append(s.toLowerCase());
        else if ( Character.isLowerCase(s.charAt(0)) )
          str.append(s.toUpperCase());
        else
          str.append(s);
      }

      System.out.println(str);
    }
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

  public static void main(String[] args) throws IOException {
    
    try( BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      String line = br.readLine();
      StringBuffer str = new StringBuffer(line.length());
      String s;

      for(int i = 0;i < line.length();i++) {
        s = line.substring(i,i+1);
        if( Character.isUpperCase(s.charAt(0)) )
          str.append(s.toLowerCase());
        else if ( Character.isLowerCase(s.charAt(0)) )
          str.append(s.toUpperCase());
        else
          str.append(s);
      }

      System.out.println(str);
    }
  }
} Main public static void main(String[] args) throws IOException {
    
    try( BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      String line = br.readLine();
      StringBuffer str = new StringBuffer(line.length());
      String s;

      for(int i = 0;i < line.length();i++) {
        s = line.substring(i,i+1);
        if( Character.isUpperCase(s.charAt(0)) )
          str.append(s.toLowerCase());
        else if ( Character.isLowerCase(s.charAt(0)) )
          str.append(s.toUpperCase());
        else
          str.append(s);
      }

      System.out.println(str);
    }
  } main {
    
    try( BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      String line = br.readLine();
      StringBuffer str = new StringBuffer(line.length());
      String s;

      for(int i = 0;i < line.length();i++) {
        s = line.substring(i,i+1);
        if( Character.isUpperCase(s.charAt(0)) )
          str.append(s.toLowerCase());
        else if ( Character.isLowerCase(s.charAt(0)) )
          str.append(s.toUpperCase());
        else
          str.append(s);
      }

      System.out.println(str);
    }
  } try( BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      String line = br.readLine();
      StringBuffer str = new StringBuffer(line.length());
      String s;

      for(int i = 0;i < line.length();i++) {
        s = line.substring(i,i+1);
        if( Character.isUpperCase(s.charAt(0)) )
          str.append(s.toLowerCase());
        else if ( Character.isLowerCase(s.charAt(0)) )
          str.append(s.toUpperCase());
        else
          str.append(s);
      }

      System.out.println(str);
    } {

      String line = br.readLine();
      StringBuffer str = new StringBuffer(line.length());
      String s;

      for(int i = 0;i < line.length();i++) {
        s = line.substring(i,i+1);
        if( Character.isUpperCase(s.charAt(0)) )
          str.append(s.toLowerCase());
        else if ( Character.isLowerCase(s.charAt(0)) )
          str.append(s.toUpperCase());
        else
          str.append(s);
      }

      System.out.println(str);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String line = br.readLine(); line br.readLine() br.readLine br StringBuffer str = new StringBuffer(line.length()); str new StringBuffer(line.length()) String s; s for(int i = 0;i < line.length();i++) {
        s = line.substring(i,i+1);
        if( Character.isUpperCase(s.charAt(0)) )
          str.append(s.toLowerCase());
        else if ( Character.isLowerCase(s.charAt(0)) )
          str.append(s.toUpperCase());
        else
          str.append(s);
      } int i = 0; int i = 0; i 0 i < line.length() i line.length() line.length line i++ i++ i {
        s = line.substring(i,i+1);
        if( Character.isUpperCase(s.charAt(0)) )
          str.append(s.toLowerCase());
        else if ( Character.isLowerCase(s.charAt(0)) )
          str.append(s.toUpperCase());
        else
          str.append(s);
      } {
        s = line.substring(i,i+1);
        if( Character.isUpperCase(s.charAt(0)) )
          str.append(s.toLowerCase());
        else if ( Character.isLowerCase(s.charAt(0)) )
          str.append(s.toUpperCase());
        else
          str.append(s);
      } s = line.substring(i,i+1) s line.substring(i,i+1) line.substring line i i+1 i 1 if( Character.isUpperCase(s.charAt(0)) )
          str.append(s.toLowerCase());
        else if ( Character.isLowerCase(s.charAt(0)) )
          str.append(s.toUpperCase());
        else
          str.append(s); Character.isUpperCase(s.charAt(0)) Character.isUpperCase Character s.charAt(0) s.charAt s 0 str.append(s.toLowerCase()) str.append str s.toLowerCase() s.toLowerCase s if ( Character.isLowerCase(s.charAt(0)) )
          str.append(s.toUpperCase());
        else
          str.append(s); Character.isLowerCase(s.charAt(0)) Character.isLowerCase Character s.charAt(0) s.charAt s 0 str.append(s.toUpperCase()) str.append str s.toUpperCase() s.toUpperCase s str.append(s) str.append str s System.out.println(str) System.out.println System.out System System.out str String[] args args public class Main {

  public static void main(String[] args) throws IOException {
    
    try( BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      String line = br.readLine();
      StringBuffer str = new StringBuffer(line.length());
      String s;

      for(int i = 0;i < line.length();i++) {
        s = line.substring(i,i+1);
        if( Character.isUpperCase(s.charAt(0)) )
          str.append(s.toLowerCase());
        else if ( Character.isLowerCase(s.charAt(0)) )
          str.append(s.toUpperCase());
        else
          str.append(s);
      }

      System.out.println(str);
    }
  }
} public class Main {

  public static void main(String[] args) throws IOException {
    
    try( BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      String line = br.readLine();
      StringBuffer str = new StringBuffer(line.length());
      String s;

      for(int i = 0;i < line.length();i++) {
        s = line.substring(i,i+1);
        if( Character.isUpperCase(s.charAt(0)) )
          str.append(s.toLowerCase());
        else if ( Character.isLowerCase(s.charAt(0)) )
          str.append(s.toUpperCase());
        else
          str.append(s);
      }

      System.out.println(str);
    }
  }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws IOException {
    
    try( BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      String line = br.readLine();
      StringBuffer str = new StringBuffer(line.length());
      String s;

      for(int i = 0;i < line.length();i++) {
        s = line.substring(i,i+1);
        if( Character.isUpperCase(s.charAt(0)) )
          str.append(s.toLowerCase());
        else if ( Character.isLowerCase(s.charAt(0)) )
          str.append(s.toUpperCase());
        else
          str.append(s);
      }

      System.out.println(str);
    }
  }
}
