#include<iostream>
using namespace std;
int main( )
{
int n;
string s;
cin>>n;
while(n--)
cin>>s;
for(int i=0; i<s.size(); i++)
if(s[i]=='X' || s[i]=='Y' || s[i]=='Z') s[i]-=23;
else s[i]+=3;
cout<<s[i];
}
cout<<endl;