/* ITP1_8_A */
import java.io.*;

class Main
{
  public static void main(String[] args)
  {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      String str = br.readLine();

      for(char c : str.toCharArray()){
        if(Character.isUpperCase(c)){
          sb.append(Character.toLowerCase(c));
        }else if(Character.isLowerCase(c)){
          sb.append(Character.toUpperCase(c));
        }else {
          sb.append(c);
        }
      }
      System.out.println(sb);

    }catch(Exception e){
      System.out.println(e);
    }
  }
} import java.io.*; io.* java class Main
{
  public static void main(String[] args)
  {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      String str = br.readLine();

      for(char c : str.toCharArray()){
        if(Character.isUpperCase(c)){
          sb.append(Character.toLowerCase(c));
        }else if(Character.isLowerCase(c)){
          sb.append(Character.toUpperCase(c));
        }else {
          sb.append(c);
        }
      }
      System.out.println(sb);

    }catch(Exception e){
      System.out.println(e);
    }
  }
} Main public static void main(String[] args)
  {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      String str = br.readLine();

      for(char c : str.toCharArray()){
        if(Character.isUpperCase(c)){
          sb.append(Character.toLowerCase(c));
        }else if(Character.isLowerCase(c)){
          sb.append(Character.toUpperCase(c));
        }else {
          sb.append(c);
        }
      }
      System.out.println(sb);

    }catch(Exception e){
      System.out.println(e);
    }
  } main {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      String str = br.readLine();

      for(char c : str.toCharArray()){
        if(Character.isUpperCase(c)){
          sb.append(Character.toLowerCase(c));
        }else if(Character.isLowerCase(c)){
          sb.append(Character.toUpperCase(c));
        }else {
          sb.append(c);
        }
      }
      System.out.println(sb);

    }catch(Exception e){
      System.out.println(e);
    }
  } try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      String str = br.readLine();

      for(char c : str.toCharArray()){
        if(Character.isUpperCase(c)){
          sb.append(Character.toLowerCase(c));
        }else if(Character.isLowerCase(c)){
          sb.append(Character.toUpperCase(c));
        }else {
          sb.append(c);
        }
      }
      System.out.println(sb);

    }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 br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      String str = br.readLine();

      for(char c : str.toCharArray()){
        if(Character.isUpperCase(c)){
          sb.append(Character.toLowerCase(c));
        }else if(Character.isLowerCase(c)){
          sb.append(Character.toUpperCase(c));
        }else {
          sb.append(c);
        }
      }
      System.out.println(sb);

    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() String str = br.readLine(); str br.readLine() br.readLine br for(char c : str.toCharArray()){
        if(Character.isUpperCase(c)){
          sb.append(Character.toLowerCase(c));
        }else if(Character.isLowerCase(c)){
          sb.append(Character.toUpperCase(c));
        }else {
          sb.append(c);
        }
      } char c str.toCharArray() str.toCharArray str {
        if(Character.isUpperCase(c)){
          sb.append(Character.toLowerCase(c));
        }else if(Character.isLowerCase(c)){
          sb.append(Character.toUpperCase(c));
        }else {
          sb.append(c);
        }
      } {
        if(Character.isUpperCase(c)){
          sb.append(Character.toLowerCase(c));
        }else if(Character.isLowerCase(c)){
          sb.append(Character.toUpperCase(c));
        }else {
          sb.append(c);
        }
      } if(Character.isUpperCase(c)){
          sb.append(Character.toLowerCase(c));
        }else if(Character.isLowerCase(c)){
          sb.append(Character.toUpperCase(c));
        }else {
          sb.append(c);
        } Character.isUpperCase(c) Character.isUpperCase Character c {
          sb.append(Character.toLowerCase(c));
        } sb.append(Character.toLowerCase(c)) sb.append sb Character.toLowerCase(c) Character.toLowerCase Character c if(Character.isLowerCase(c)){
          sb.append(Character.toUpperCase(c));
        }else {
          sb.append(c);
        } Character.isLowerCase(c) Character.isLowerCase Character c {
          sb.append(Character.toUpperCase(c));
        } sb.append(Character.toUpperCase(c)) sb.append sb Character.toUpperCase(c) Character.toUpperCase Character c {
          sb.append(c);
        } sb.append(c) sb.append sb c System.out.println(sb) System.out.println System.out System System.out sb String[] args args
/* ITP1_8_A */
import java.io.*;

class Main
{
  public static void main(String[] args)
  {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      String str = br.readLine();

      for(char c : str.toCharArray()){
        if(Character.isUpperCase(c)){
          sb.append(Character.toLowerCase(c));
        }else if(Character.isLowerCase(c)){
          sb.append(Character.toUpperCase(c));
        }else {
          sb.append(c);
        }
      }
      System.out.println(sb);

    }catch(Exception e){
      System.out.println(e);
    }
  }
}