import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while(scan.hasNextLine()) {
String str = scan.nextLine();
if(str.matches("[a-z]")) {
System.out.println(str.toUpperCase());
} else {
System.out.println(str.toLowerCase());
}
}
}
}