package yukicoder; import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Yuki163 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String str = scan.next(); scan.close(); String[] strarr = str.split(""); String bigEng = "[A-Z]"; String smallEng = "[a-z]"; Pattern p1 = Pattern.compile(bigEng); Pattern p2 = Pattern.compile(smallEng); for (int i = 0; i < strarr.length; i++ ){ Matcher m = p1.matcher(strarr[i]); Matcher m1 = p2.matcher(strarr[i]); if(m.find()){ strarr[i] = strarr[i].toLowerCase(); }else if(m1.find()){ strarr[i] = strarr[i].toUpperCase(); } System.out.print(strarr[i]); } } }