import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String S = reader.readLine(); StringBuilder builder = new StringBuilder(); for (int i = 0; i < S.length(); i++) { if(Character.isUpperCase(S.charAt(i))){ builder.append(Character.toLowerCase(S.charAt(i))); } else { builder.append(Character.toUpperCase(S.charAt(i))); } } System.out.println(builder.toString()); } }