import java.io.*;

class Main{
    public static void main(String[] args) throws IOException
    {
        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);
        String line = br.readLine();
        char[] str = new char[line.length()];
        char c;
        for(int i = 0; i < line.length(); i++){
            c = line.charAt(i);
            if(c >= 65 && c <= 90){ c += 32; }
            else if(c >= 97 && c <= 122){ c -= 32; }
            str[i] = c;
        }
        String newline = new String(str);
        System.out.println(newline);
    }
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz