#include <bits/stdc++.h>
using namespace std;

int main() {
    string str;
    getline(cin, str);

    for (char &c : str) {
        if ('a' <= c && c <= 'z')
            c = c - 'a' + 'A';
        else if ('A' <= c && c <= 'Z')
            c = c - 'A' + 'a';
    }

    cout << str;

    return 0;
}