import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); StringBuffer sb = new StringBuffer(); for(int i = 0; i < s.length(); i++) { if(Character.isUpperCase(s.charAt(i))) sb.insert(i, Character.toLowerCase(s.charAt(i))); else sb.insert(i, Character.toUpperCase(s.charAt(i))); } System.out.println(sb.toString()); } }