#include <stdio.h>
#include <string.h>
const int maxn = 500010;
char s[maxn] = { '\0' }, ans[maxn] = { '\0' };
int time[26] = { 0 };
int main(void) {
int t, len, i, max, cnt=0;
char maxc;
gets(s);
while (!strcmp(s, "START")) {
cnt++;
gets(s);
max = 0;
len = strlen(s);
for (i = 0; i < len; i++) {
if (s[i] >= 'a'&&s[i] <= 'z')
s[i] -= 32;
if(s[i]>='A'&&s[i]<='Z')
time[s[i] - 'A']++;
}
if (cnt == 1) {
for (i = 0; i < 26; i++) {
if (time[i] > max) {
max = time[i];
maxc = 'A' + i;
}
}
t = maxc - 'E';
}
for (i = 0; i < len; i++) {
if (s[i] >= 'A'&&s[i] <= 'Z') {
s[i] -= t;
if (s[i] < 'A') s[i] += 26;
else if (s[i] > 'Z') s[i] -= 26;
}
}
printf("%s\n", s);
gets(s);
gets(s);
}
return 0;
}