#include<bits/stdc++.h>
using namespace std;
string Big(string ori)
{
for (int i=0;i<ori.length();i++){
if ('a'<=ori[i] && ori[i]<='z'){
ori[i]-=32;
}
}
return ori;
}
string Trans(string ori,int t){
string ans;
for (int i=0;i<ori.length();i++){
if ('a'<=ori[i] && ori[i]<='z'){
if (ori[i]-'a'+1>=t)ans+=ori[i]-t+1;
else ans+='z'-t+(ori[i]-'a')+2;
}
else if ('A'<=ori[i] && ori[i]<='Z'){
if (ori[i]-'A'+1>=t)ans+=ori[i]-t+1;
else ans+='Z'-t+(ori[i]-'A')+2;
}
else ans+=ori[i];
}
return ans;
}
int main(){
int Poss[27];string m[10001];
string tmp;
while(cin>>tmp){
if (tmp=="ENDOFINPUT")return 0;
if (tmp=="START"){
cin>>m[1];
int ptr=1;
while(m[ptr]!="END"){
cin>>m[++ptr];
if (m[ptr]=="END")continue;
for (int j=0;j<m[ptr].length();j++){
if ('a'<=m[ptr][j] && m[ptr][j]<='z')Poss[m[ptr][j]-'a']++;
else if ('A'<=m[ptr][j] && m[ptr][j]<='Z')Poss[m[ptr][j]-'A']++;
}
}
int maxxx=-1,maxx;
for (int j=0;j<26;j++){
if (Poss[j]>=maxxx)maxxx=Poss[j],maxx=j;
}
for (int j=1;j<ptr;j++)cout<<Big(Trans(m[j],maxx-3))<<" ";
cout<<endl;
}
}
}