import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String a = sc.next();
}
}
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String a = sc.next();
String result = "";
for (int i = 0; i < a.length(); i++) {
char c = a.charAt(i);
if (Character.isLowerCase(c)) {
result += Character.toUpperCase(c);
} else {
result += Character.toLowerCase(c);
}
}
System.out.println(result);
}
}
char c = a.charAt(i)
Character.isLowerCase(c)
Character.toUpperCase(c)
Character.toLowerCase(c)