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

class Main {
  public static void main(String[] args) {
    try {
      BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
      String input = stdReader.readLine();
      StringBuilder output = new StringBuilder();
      
      for (int i = 0; i < input.length(); i++) {
        int c = (int)input.charAt(i);
        if     (c >= 65 && c <= 90)  output.append(lowerCase(input.charAt(i)));
        else if(c >= 97 && c <= 122) output.append(upperCase(input.charAt(i)));
        else                         output.append(input.charAt(i));
      }
      System.out.println(output.toString());
    } catch (Exception e) {
      System.out.println(e);
    }
  }
  
  public static char lowerCase(char c){
    return (char)(c + 32);
  }
  
  public static char upperCase(char c){
    return (char)(c - 32);
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {
  public static void main(String[] args) {
    try {
      BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
      String input = stdReader.readLine();
      StringBuilder output = new StringBuilder();
      
      for (int i = 0; i < input.length(); i++) {
        int c = (int)input.charAt(i);
        if     (c >= 65 && c <= 90)  output.append(lowerCase(input.charAt(i)));
        else if(c >= 97 && c <= 122) output.append(upperCase(input.charAt(i)));
        else                         output.append(input.charAt(i));
      }
      System.out.println(output.toString());
    } catch (Exception e) {
      System.out.println(e);
    }
  }
  
  public static char lowerCase(char c){
    return (char)(c + 32);
  }
  
  public static char upperCase(char c){
    return (char)(c - 32);
  }
} Main public static void main(String[] args) {
    try {
      BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
      String input = stdReader.readLine();
      StringBuilder output = new StringBuilder();
      
      for (int i = 0; i < input.length(); i++) {
        int c = (int)input.charAt(i);
        if     (c >= 65 && c <= 90)  output.append(lowerCase(input.charAt(i)));
        else if(c >= 97 && c <= 122) output.append(upperCase(input.charAt(i)));
        else                         output.append(input.charAt(i));
      }
      System.out.println(output.toString());
    } catch (Exception e) {
      System.out.println(e);
    }
  } main {
    try {
      BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
      String input = stdReader.readLine();
      StringBuilder output = new StringBuilder();
      
      for (int i = 0; i < input.length(); i++) {
        int c = (int)input.charAt(i);
        if     (c >= 65 && c <= 90)  output.append(lowerCase(input.charAt(i)));
        else if(c >= 97 && c <= 122) output.append(upperCase(input.charAt(i)));
        else                         output.append(input.charAt(i));
      }
      System.out.println(output.toString());
    } catch (Exception e) {
      System.out.println(e);
    }
  } try {
      BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
      String input = stdReader.readLine();
      StringBuilder output = new StringBuilder();
      
      for (int i = 0; i < input.length(); i++) {
        int c = (int)input.charAt(i);
        if     (c >= 65 && c <= 90)  output.append(lowerCase(input.charAt(i)));
        else if(c >= 97 && c <= 122) output.append(upperCase(input.charAt(i)));
        else                         output.append(input.charAt(i));
      }
      System.out.println(output.toString());
    } catch (Exception e) {
      System.out.println(e);
    } catch (Exception e) {
      System.out.println(e);
    } Exception e {
      System.out.println(e);
    } System.out.println(e) System.out.println System.out System System.out e {
      BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
      String input = stdReader.readLine();
      StringBuilder output = new StringBuilder();
      
      for (int i = 0; i < input.length(); i++) {
        int c = (int)input.charAt(i);
        if     (c >= 65 && c <= 90)  output.append(lowerCase(input.charAt(i)));
        else if(c >= 97 && c <= 122) output.append(upperCase(input.charAt(i)));
        else                         output.append(input.charAt(i));
      }
      System.out.println(output.toString());
    } BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in)); stdReader new BufferedReader(new InputStreamReader(System.in)) String input = stdReader.readLine(); input stdReader.readLine() stdReader.readLine stdReader StringBuilder output = new StringBuilder(); output new StringBuilder() for (int i = 0; i < input.length(); i++) {
        int c = (int)input.charAt(i);
        if     (c >= 65 && c <= 90)  output.append(lowerCase(input.charAt(i)));
        else if(c >= 97 && c <= 122) output.append(upperCase(input.charAt(i)));
        else                         output.append(input.charAt(i));
      } int i = 0; int i = 0; i 0 i < input.length() i input.length() input.length input i++ i++ i {
        int c = (int)input.charAt(i);
        if     (c >= 65 && c <= 90)  output.append(lowerCase(input.charAt(i)));
        else if(c >= 97 && c <= 122) output.append(upperCase(input.charAt(i)));
        else                         output.append(input.charAt(i));
      } {
        int c = (int)input.charAt(i);
        if     (c >= 65 && c <= 90)  output.append(lowerCase(input.charAt(i)));
        else if(c >= 97 && c <= 122) output.append(upperCase(input.charAt(i)));
        else                         output.append(input.charAt(i));
      } int c = (int)input.charAt(i); c (int)input.charAt(i) input.charAt input i if     (c >= 65 && c <= 90)  output.append(lowerCase(input.charAt(i)));
        else if(c >= 97 && c <= 122) output.append(upperCase(input.charAt(i)));
        else                         output.append(input.charAt(i)); c >= 65 && c <= 90 c >= 65 c 65 c <= 90 c 90 output.append(lowerCase(input.charAt(i))) output.append output lowerCase(input.charAt(i)) lowerCase input.charAt(i) input.charAt input i if(c >= 97 && c <= 122) output.append(upperCase(input.charAt(i)));
        else                         output.append(input.charAt(i)); c >= 97 && c <= 122 c >= 97 c 97 c <= 122 c 122 output.append(upperCase(input.charAt(i))) output.append output upperCase(input.charAt(i)) upperCase input.charAt(i) input.charAt input i output.append(input.charAt(i)) output.append output input.charAt(i) input.charAt input i System.out.println(output.toString()) System.out.println System.out System System.out output.toString() output.toString output String[] args args public static char lowerCase(char c){
    return (char)(c + 32);
  } lowerCase {
    return (char)(c + 32);
  } return (char)(c + 32); (char)(c + 32) c 32 char c c public static char upperCase(char c){
    return (char)(c - 32);
  } upperCase {
    return (char)(c - 32);
  } return (char)(c - 32); (char)(c - 32) c 32 char c c
import java.io.BufferedReader;
import java.io.InputStreamReader;

class Main {
  public static void main(String[] args) {
    try {
      BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
      String input = stdReader.readLine();
      StringBuilder output = new StringBuilder();
      
      for (int i = 0; i < input.length(); i++) {
        int c = (int)input.charAt(i);
        if     (c >= 65 && c <= 90)  output.append(lowerCase(input.charAt(i)));
        else if(c >= 97 && c <= 122) output.append(upperCase(input.charAt(i)));
        else                         output.append(input.charAt(i));
      }
      System.out.println(output.toString());
    } catch (Exception e) {
      System.out.println(e);
    }
  }
  
  public static char lowerCase(char c){
    return (char)(c + 32);
  }
  
  public static char upperCase(char c){
    return (char)(c - 32);
  }
}