import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    char c;
    for(int i= 0;i < s.length();i++){
      c = s.charAt(i);
      if(c >= 'A' && c <= 'Z'){
        c += 'a'-'A';
      }else if(c >= 'a' && c <= 'z'){
        c += 'A'-'a';
      }
      System.out.print(c);
    }
    System.out.println("");
    sc.close();
  }
}
 import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    char c;
    for(int i= 0;i < s.length();i++){
      c = s.charAt(i);
      if(c >= 'A' && c <= 'Z'){
        c += 'a'-'A';
      }else if(c >= 'a' && c <= 'z'){
        c += 'A'-'a';
      }
      System.out.print(c);
    }
    System.out.println("");
    sc.close();
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    char c;
    for(int i= 0;i < s.length();i++){
      c = s.charAt(i);
      if(c >= 'A' && c <= 'Z'){
        c += 'a'-'A';
      }else if(c >= 'a' && c <= 'z'){
        c += 'A'-'a';
      }
      System.out.print(c);
    }
    System.out.println("");
    sc.close();
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    char c;
    for(int i= 0;i < s.length();i++){
      c = s.charAt(i);
      if(c >= 'A' && c <= 'Z'){
        c += 'a'-'A';
      }else if(c >= 'a' && c <= 'z'){
        c += 'A'-'a';
      }
      System.out.print(c);
    }
    System.out.println("");
    sc.close();
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc char c; c for(int i= 0;i < s.length();i++){
      c = s.charAt(i);
      if(c >= 'A' && c <= 'Z'){
        c += 'a'-'A';
      }else if(c >= 'a' && c <= 'z'){
        c += 'A'-'a';
      }
      System.out.print(c);
    } int i= 0; int i= 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
      c = s.charAt(i);
      if(c >= 'A' && c <= 'Z'){
        c += 'a'-'A';
      }else if(c >= 'a' && c <= 'z'){
        c += 'A'-'a';
      }
      System.out.print(c);
    } {
      c = s.charAt(i);
      if(c >= 'A' && c <= 'Z'){
        c += 'a'-'A';
      }else if(c >= 'a' && c <= 'z'){
        c += 'A'-'a';
      }
      System.out.print(c);
    } c = s.charAt(i) c s.charAt(i) s.charAt s i if(c >= 'A' && c <= 'Z'){
        c += 'a'-'A';
      }else if(c >= 'a' && c <= 'z'){
        c += 'A'-'a';
      } c >= 'A' && c <= 'Z' c >= 'A' c 'A' c <= 'Z' c 'Z' {
        c += 'a'-'A';
      } c += 'a'-'A' c 'a'-'A' 'a' 'A' if(c >= 'a' && c <= 'z'){
        c += 'A'-'a';
      } c >= 'a' && c <= 'z' c >= 'a' c 'a' c <= 'z' c 'z' {
        c += 'A'-'a';
      } c += 'A'-'a' c 'A'-'a' 'A' 'a' System.out.print(c) System.out.print System.out System System.out c System.out.println("") System.out.println System.out System System.out "" sc.close() sc.close sc String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    char c;
    for(int i= 0;i < s.length();i++){
      c = s.charAt(i);
      if(c >= 'A' && c <= 'Z'){
        c += 'a'-'A';
      }else if(c >= 'a' && c <= 'z'){
        c += 'A'-'a';
      }
      System.out.print(c);
    }
    System.out.println("");
    sc.close();
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    char c;
    for(int i= 0;i < s.length();i++){
      c = s.charAt(i);
      if(c >= 'A' && c <= 'Z'){
        c += 'a'-'A';
      }else if(c >= 'a' && c <= 'z'){
        c += 'A'-'a';
      }
      System.out.print(c);
    }
    System.out.println("");
    sc.close();
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    char c;
    for(int i= 0;i < s.length();i++){
      c = s.charAt(i);
      if(c >= 'A' && c <= 'Z'){
        c += 'a'-'A';
      }else if(c >= 'a' && c <= 'z'){
        c += 'A'-'a';
      }
      System.out.print(c);
    }
    System.out.println("");
    sc.close();
  }
}

