import java.io.*;

public class Main {
  public static void main(String[] args) {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    try {
      char[] str = reader.readLine().toCharArray();

      for (int i = 0; i < str.length; i++) {
        if (Character.isUpperCase(str[i])) {
          System.out.print(Character.toLowerCase(str[i]));
        }
        else if (Character.isLowerCase(str[i])) {
          System.out.print(Character.toUpperCase(str[i]));
        }
        else {
          System.out.print(str[i]);
        }
      }
      System.out.println();
    }
    catch (IOException e) {
      System.out.println(e);
    }
  }
} import java.io.*; io.* java public class Main {
  public static void main(String[] args) {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    try {
      char[] str = reader.readLine().toCharArray();

      for (int i = 0; i < str.length; i++) {
        if (Character.isUpperCase(str[i])) {
          System.out.print(Character.toLowerCase(str[i]));
        }
        else if (Character.isLowerCase(str[i])) {
          System.out.print(Character.toUpperCase(str[i]));
        }
        else {
          System.out.print(str[i]);
        }
      }
      System.out.println();
    }
    catch (IOException e) {
      System.out.println(e);
    }
  }
} Main public static void main(String[] args) {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    try {
      char[] str = reader.readLine().toCharArray();

      for (int i = 0; i < str.length; i++) {
        if (Character.isUpperCase(str[i])) {
          System.out.print(Character.toLowerCase(str[i]));
        }
        else if (Character.isLowerCase(str[i])) {
          System.out.print(Character.toUpperCase(str[i]));
        }
        else {
          System.out.print(str[i]);
        }
      }
      System.out.println();
    }
    catch (IOException e) {
      System.out.println(e);
    }
  } main {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    try {
      char[] str = reader.readLine().toCharArray();

      for (int i = 0; i < str.length; i++) {
        if (Character.isUpperCase(str[i])) {
          System.out.print(Character.toLowerCase(str[i]));
        }
        else if (Character.isLowerCase(str[i])) {
          System.out.print(Character.toUpperCase(str[i]));
        }
        else {
          System.out.print(str[i]);
        }
      }
      System.out.println();
    }
    catch (IOException e) {
      System.out.println(e);
    }
  } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) try {
      char[] str = reader.readLine().toCharArray();

      for (int i = 0; i < str.length; i++) {
        if (Character.isUpperCase(str[i])) {
          System.out.print(Character.toLowerCase(str[i]));
        }
        else if (Character.isLowerCase(str[i])) {
          System.out.print(Character.toUpperCase(str[i]));
        }
        else {
          System.out.print(str[i]);
        }
      }
      System.out.println();
    }
    catch (IOException e) {
      System.out.println(e);
    } catch (IOException e) {
      System.out.println(e);
    } IOException e {
      System.out.println(e);
    } System.out.println(e) System.out.println System.out System System.out e {
      char[] str = reader.readLine().toCharArray();

      for (int i = 0; i < str.length; i++) {
        if (Character.isUpperCase(str[i])) {
          System.out.print(Character.toLowerCase(str[i]));
        }
        else if (Character.isLowerCase(str[i])) {
          System.out.print(Character.toUpperCase(str[i]));
        }
        else {
          System.out.print(str[i]);
        }
      }
      System.out.println();
    } char[] str = reader.readLine().toCharArray(); str reader.readLine().toCharArray() reader.readLine().toCharArray reader.readLine() reader.readLine reader for (int i = 0; i < str.length; i++) {
        if (Character.isUpperCase(str[i])) {
          System.out.print(Character.toLowerCase(str[i]));
        }
        else if (Character.isLowerCase(str[i])) {
          System.out.print(Character.toUpperCase(str[i]));
        }
        else {
          System.out.print(str[i]);
        }
      } int i = 0; int i = 0; i 0 i < str.length i str.length str str.length i++ i++ i {
        if (Character.isUpperCase(str[i])) {
          System.out.print(Character.toLowerCase(str[i]));
        }
        else if (Character.isLowerCase(str[i])) {
          System.out.print(Character.toUpperCase(str[i]));
        }
        else {
          System.out.print(str[i]);
        }
      } {
        if (Character.isUpperCase(str[i])) {
          System.out.print(Character.toLowerCase(str[i]));
        }
        else if (Character.isLowerCase(str[i])) {
          System.out.print(Character.toUpperCase(str[i]));
        }
        else {
          System.out.print(str[i]);
        }
      } if (Character.isUpperCase(str[i])) {
          System.out.print(Character.toLowerCase(str[i]));
        }
        else if (Character.isLowerCase(str[i])) {
          System.out.print(Character.toUpperCase(str[i]));
        }
        else {
          System.out.print(str[i]);
        } Character.isUpperCase(str[i]) Character.isUpperCase Character str[i] str i {
          System.out.print(Character.toLowerCase(str[i]));
        } System.out.print(Character.toLowerCase(str[i])) System.out.print System.out System System.out Character.toLowerCase(str[i]) Character.toLowerCase Character str[i] str i if (Character.isLowerCase(str[i])) {
          System.out.print(Character.toUpperCase(str[i]));
        }
        else {
          System.out.print(str[i]);
        } Character.isLowerCase(str[i]) Character.isLowerCase Character str[i] str i {
          System.out.print(Character.toUpperCase(str[i]));
        } System.out.print(Character.toUpperCase(str[i])) System.out.print System.out System System.out Character.toUpperCase(str[i]) Character.toUpperCase Character str[i] str i {
          System.out.print(str[i]);
        } System.out.print(str[i]) System.out.print System.out System System.out str[i] str i System.out.println() System.out.println System.out System System.out String[] args args public class Main {
  public static void main(String[] args) {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    try {
      char[] str = reader.readLine().toCharArray();

      for (int i = 0; i < str.length; i++) {
        if (Character.isUpperCase(str[i])) {
          System.out.print(Character.toLowerCase(str[i]));
        }
        else if (Character.isLowerCase(str[i])) {
          System.out.print(Character.toUpperCase(str[i]));
        }
        else {
          System.out.print(str[i]);
        }
      }
      System.out.println();
    }
    catch (IOException e) {
      System.out.println(e);
    }
  }
} public class Main {
  public static void main(String[] args) {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    try {
      char[] str = reader.readLine().toCharArray();

      for (int i = 0; i < str.length; i++) {
        if (Character.isUpperCase(str[i])) {
          System.out.print(Character.toLowerCase(str[i]));
        }
        else if (Character.isLowerCase(str[i])) {
          System.out.print(Character.toUpperCase(str[i]));
        }
        else {
          System.out.print(str[i]);
        }
      }
      System.out.println();
    }
    catch (IOException e) {
      System.out.println(e);
    }
  }
} Main
import java.io.*;

public class Main {
  public static void main(String[] args) {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    try {
      char[] str = reader.readLine().toCharArray();

      for (int i = 0; i < str.length; i++) {
        if (Character.isUpperCase(str[i])) {
          System.out.print(Character.toLowerCase(str[i]));
        }
        else if (Character.isLowerCase(str[i])) {
          System.out.print(Character.toUpperCase(str[i]));
        }
        else {
          System.out.print(str[i]);
        }
      }
      System.out.println();
    }
    catch (IOException e) {
      System.out.println(e);
    }
  }
}