import java.util.*; import java.util.stream.*; public class Main{ public static void main(String... args){ Scanner sc=new Scanner(System.in); String string=sc.next(); StringBuilder sb=new StringBuilder(); for(char c:string.toCharArray()){ if(Character.isUpperCase(c)){ sb.append(Character.toLowerCase(c)); }else{ sb.append(Character.toUpperCase(c)); } } System.out.println(sb); } }