import std.stdio, std.string, std.uni;

void main() {
    string str = readln.chomp;
    foreach (x; str) {
        if (x.isUpper) {
            x.toLower.write;
        } else if (x.isLower) {
            x.toUpper.write;
        } else {
            x.write;
        }
    }
    writeln;
}
