import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String s = scan.next(); char[] c = s.toCharArray(); for (int i = 0; i < c.length; i++) { if (Character.isLowerCase(c[i])) { c[i] = Character.toUpperCase(c[i]); } else { c[i] = Character.toLowerCase(c[i]); } } System.out.println(new String(c)); scan.close(); } }