import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
char a = sc.next().charAt(0);
if (a >= 'A' && a <= 'Z')
System.out.println((char) (a + 32));
else if (a >= 'a' && a <= 'z')
System.out.println((char) (a - 32)) ;
else
System.out.println((int)a);
}
}