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