//aoj10018
import std.stdio;
import std.ascii;

void main()
{
    char c;
    dchar c1;
    
    while(1)
    {
        scanf("%c", &c);
        if(c == '\n') break;
        if(isLower(c) != 0) c1 = toUpper(c);
        else if(isUpper(c) != 0) c1 = toLower(c);
        else c1 = c;
        write(c1);
    }
    writeln();
}