import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] str = sc.nextLine().split(" ");
    for(int i = 0; i < str.length; i++) {
      String[] word = str[i].split("");
      String s = "";
      for(int j = 0; j < word.length; j++) {
        if(word[j].matches("[a-z]")) {
          s += word[j].toUpperCase();
        } else if(word[j].matches("[A-Z]")) {
          s += word[j].toLowerCase();
        } else {
          s += word[j];
        }
      }
      str[i] = s;
      if(i == str.length - 1) {
        System.out.println(str[i]);
      } else {
        System.out.print(str[i] + " ");
      }
    }
  }
}
 import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] str = sc.nextLine().split(" ");
    for(int i = 0; i < str.length; i++) {
      String[] word = str[i].split("");
      String s = "";
      for(int j = 0; j < word.length; j++) {
        if(word[j].matches("[a-z]")) {
          s += word[j].toUpperCase();
        } else if(word[j].matches("[A-Z]")) {
          s += word[j].toLowerCase();
        } else {
          s += word[j];
        }
      }
      str[i] = s;
      if(i == str.length - 1) {
        System.out.println(str[i]);
      } else {
        System.out.print(str[i] + " ");
      }
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] str = sc.nextLine().split(" ");
    for(int i = 0; i < str.length; i++) {
      String[] word = str[i].split("");
      String s = "";
      for(int j = 0; j < word.length; j++) {
        if(word[j].matches("[a-z]")) {
          s += word[j].toUpperCase();
        } else if(word[j].matches("[A-Z]")) {
          s += word[j].toLowerCase();
        } else {
          s += word[j];
        }
      }
      str[i] = s;
      if(i == str.length - 1) {
        System.out.println(str[i]);
      } else {
        System.out.print(str[i] + " ");
      }
    }
  } main {
    Scanner sc = new Scanner(System.in);
    String[] str = sc.nextLine().split(" ");
    for(int i = 0; i < str.length; i++) {
      String[] word = str[i].split("");
      String s = "";
      for(int j = 0; j < word.length; j++) {
        if(word[j].matches("[a-z]")) {
          s += word[j].toUpperCase();
        } else if(word[j].matches("[A-Z]")) {
          s += word[j].toLowerCase();
        } else {
          s += word[j];
        }
      }
      str[i] = s;
      if(i == str.length - 1) {
        System.out.println(str[i]);
      } else {
        System.out.print(str[i] + " ");
      }
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] str = sc.nextLine().split(" "); str sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " for(int i = 0; i < str.length; i++) {
      String[] word = str[i].split("");
      String s = "";
      for(int j = 0; j < word.length; j++) {
        if(word[j].matches("[a-z]")) {
          s += word[j].toUpperCase();
        } else if(word[j].matches("[A-Z]")) {
          s += word[j].toLowerCase();
        } else {
          s += word[j];
        }
      }
      str[i] = s;
      if(i == str.length - 1) {
        System.out.println(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 {
      String[] word = str[i].split("");
      String s = "";
      for(int j = 0; j < word.length; j++) {
        if(word[j].matches("[a-z]")) {
          s += word[j].toUpperCase();
        } else if(word[j].matches("[A-Z]")) {
          s += word[j].toLowerCase();
        } else {
          s += word[j];
        }
      }
      str[i] = s;
      if(i == str.length - 1) {
        System.out.println(str[i]);
      } else {
        System.out.print(str[i] + " ");
      }
    } {
      String[] word = str[i].split("");
      String s = "";
      for(int j = 0; j < word.length; j++) {
        if(word[j].matches("[a-z]")) {
          s += word[j].toUpperCase();
        } else if(word[j].matches("[A-Z]")) {
          s += word[j].toLowerCase();
        } else {
          s += word[j];
        }
      }
      str[i] = s;
      if(i == str.length - 1) {
        System.out.println(str[i]);
      } else {
        System.out.print(str[i] + " ");
      }
    } String[] word = str[i].split(""); word str[i].split("") str[i].split str[i] str i "" String s = ""; s "" for(int j = 0; j < word.length; j++) {
        if(word[j].matches("[a-z]")) {
          s += word[j].toUpperCase();
        } else if(word[j].matches("[A-Z]")) {
          s += word[j].toLowerCase();
        } else {
          s += word[j];
        }
      } int j = 0; int j = 0; j 0 j < word.length j word.length word word.length j++ j++ j {
        if(word[j].matches("[a-z]")) {
          s += word[j].toUpperCase();
        } else if(word[j].matches("[A-Z]")) {
          s += word[j].toLowerCase();
        } else {
          s += word[j];
        }
      } {
        if(word[j].matches("[a-z]")) {
          s += word[j].toUpperCase();
        } else if(word[j].matches("[A-Z]")) {
          s += word[j].toLowerCase();
        } else {
          s += word[j];
        }
      } if(word[j].matches("[a-z]")) {
          s += word[j].toUpperCase();
        } else if(word[j].matches("[A-Z]")) {
          s += word[j].toLowerCase();
        } else {
          s += word[j];
        } word[j].matches("[a-z]") word[j].matches word[j] word j "[a-z]" {
          s += word[j].toUpperCase();
        } s += word[j].toUpperCase() s word[j].toUpperCase() word[j].toUpperCase word[j] word j if(word[j].matches("[A-Z]")) {
          s += word[j].toLowerCase();
        } else {
          s += word[j];
        } word[j].matches("[A-Z]") word[j].matches word[j] word j "[A-Z]" {
          s += word[j].toLowerCase();
        } s += word[j].toLowerCase() s word[j].toLowerCase() word[j].toLowerCase word[j] word j {
          s += word[j];
        } s += word[j] s word[j] word j str[i] = s str[i] str i s if(i == str.length - 1) {
        System.out.println(str[i]);
      } else {
        System.out.print(str[i] + " ");
      } i == str.length - 1 i str.length - 1 str.length str str.length 1 {
        System.out.println(str[i]);
      } System.out.println(str[i]) System.out.println System.out System System.out 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] str i " " String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] str = sc.nextLine().split(" ");
    for(int i = 0; i < str.length; i++) {
      String[] word = str[i].split("");
      String s = "";
      for(int j = 0; j < word.length; j++) {
        if(word[j].matches("[a-z]")) {
          s += word[j].toUpperCase();
        } else if(word[j].matches("[A-Z]")) {
          s += word[j].toLowerCase();
        } else {
          s += word[j];
        }
      }
      str[i] = s;
      if(i == str.length - 1) {
        System.out.println(str[i]);
      } else {
        System.out.print(str[i] + " ");
      }
    }
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] str = sc.nextLine().split(" ");
    for(int i = 0; i < str.length; i++) {
      String[] word = str[i].split("");
      String s = "";
      for(int j = 0; j < word.length; j++) {
        if(word[j].matches("[a-z]")) {
          s += word[j].toUpperCase();
        } else if(word[j].matches("[A-Z]")) {
          s += word[j].toLowerCase();
        } else {
          s += word[j];
        }
      }
      str[i] = s;
      if(i == str.length - 1) {
        System.out.println(str[i]);
      } else {
        System.out.print(str[i] + " ");
      }
    }
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] str = sc.nextLine().split(" ");
    for(int i = 0; i < str.length; i++) {
      String[] word = str[i].split("");
      String s = "";
      for(int j = 0; j < word.length; j++) {
        if(word[j].matches("[a-z]")) {
          s += word[j].toUpperCase();
        } else if(word[j].matches("[A-Z]")) {
          s += word[j].toLowerCase();
        } else {
          s += word[j];
        }
      }
      str[i] = s;
      if(i == str.length - 1) {
        System.out.println(str[i]);
      } else {
        System.out.print(str[i] + " ");
      }
    }
  }
}

