import java.util.Scanner;
public class Bj2744 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String answer ="";
String str;
str = sc.nextLine();
for(int i = 0; i < str.length(); i++)
{
if(str.charAt(i) >= 'A' && str.charAt(i) <= 'Z')
{
answer += (char)(str.charAt(i) + 32);
}
else
{
answer += (char)(str.charAt(i) - 32);
}
}
System.out.println(answer);
sc.close();
}
}