#include <bits/stdc++.h>
using namespace std;
void solve(int test, string s)
{
for (int i = 1; i<=s.size(); i++){
if (test & 1)
cout << (char)(i & 1 ? toupper(s[i-1]) : tolower(s[i-1]));
else
cout << (char)(i & 1 ? tolower(s[i-1]) : toupper(s[i-1]));
}
cout << endl;
}
int main()
{
int t;
cin >> t;
string s;
for(int i = 1; i<=t; ++i){
cin >> s;
solve(i, s);
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp2b2lkIHNvbHZlKGludCB0ZXN0LCBzdHJpbmcgcykKewogICAgZm9yIChpbnQgaSA9IDE7IGk8PXMuc2l6ZSgpOyBpKyspewogICAgICAgIGlmICh0ZXN0ICYgMSkKICAgICAgICAgICAgY291dCA8PCAoY2hhcikoaSAmIDEgPyB0b3VwcGVyKHNbaS0xXSkgOiB0b2xvd2VyKHNbaS0xXSkpOwogICAgICAgIGVsc2UgCiAgICAgICAgICAgIGNvdXQgPDwgKGNoYXIpKGkgJiAxID8gdG9sb3dlcihzW2ktMV0pIDogdG91cHBlcihzW2ktMV0pKTsKICAgIH0KICAgIGNvdXQgPDwgZW5kbDsKfQoKaW50IG1haW4oKQp7CiAgICBpbnQgdDsKICAgIGNpbiA+PiB0OwogICAgc3RyaW5nIHM7CiAgICBmb3IoaW50IGkgPSAxOyBpPD10OyArK2kpewogICAgICAgIGNpbiA+PiBzOwogICAgICAgIHNvbHZlKGksIHMpOwogICAgfQogICAgcmV0dXJuIDA7Cn0=