import java.util.*; import java.util.regex.*; class A{ static Scanner s = new Scanner(System.in); public static void main(String[] args){ StringBuilder sb = new StringBuilder(101); Matcher m = Pattern.compile("([a-z]+|[A-Z]+)").matcher(s.next()); while(m.find()){ String st = m.group(); if(st.matches("[a-z]+")){ sb.append(st.toUpperCase()); }else{ sb.append(st.toLowerCase()); } } System.out.println(sb); } }