import java.util.*; public class No163 { public static void main(String[] arg){ Scanner sc = new Scanner(System.in); char[] s = sc.next().toCharArray(); String j ; for(int i = 0; i < s.length; i++){ j = String.valueOf(s[i]); if (j.matches( "[a-z]+" )){ j = j.toUpperCase(); s[i] = j.charAt(0); } else { j = j.toLowerCase(); s[i] = j.charAt(0); } } System.out.println(s); } }