import java.io.*; import java.util.*; import java.math.*; class Main163 { public static String solve (String str) { String ret = ""; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if ("Z".compareTo(c + "") < 0) ret += String.valueOf((char)(c - 32)); else ret += String.valueOf((char)(c + 32)); } return ret; } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = br.readLine(); System.out.println(solve(line)); } }