using System;

public class Example
{
    public static void Main()
    {
        String s;

        Console.Clear();
        s = Console.ReadLine();

        string fullstr = "";
        
        foreach(char c in s){
            if(char.IsLower(c)){
                fullstr += char.ToUpper(c);
            }
            else if(char.IsUpper(c)){
                fullstr += char.ToLower(c);
            }
        }
        Console.WriteLine(fullstr);
        
    }
}