//土尔逊Torson 编写于2023/4/18
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <string>
#include <stdlib.h>

using namespace std;

int main() {
	string str;
	while (getline(cin, str)) {       //起始行
		if (str == "ENDOFINPUT") { 
			break;
		}
		getline(cin, str);            //密文
		for (int i = 0; i < str.size(); ++i) {
			if ('A' <= str[i] && str[i] <= 'Z') {
				str[i] = (str[i] - 'A' - 5 + 26) % 26 + 'A';
			}
		}
		printf("%s\n", str.c_str());
		getline(cin, str);
	}
	system("pause");
	return EXIT_SUCCESS;
}
// 64 位输出请用 printf("%lld")