import java.io.*; class Main{ public static void main(String args[]) throws IOException{ DataInputStream d = new DataInputStream(System.in); String str = d.readLine(); String ans = ""; for(int i = 0; i < str.length(); i++){ if( (int)'a' <= (int) str.charAt(i) && (int) str.charAt(i) <= (int)'z' ){ ans += (char)(str.charAt(i) - 32); } else{ ans += (char)(str.charAt(i) + 32); } } System.out.println(ans); } }