#include <iostream>
#include <string>
using namespace std;
/*
加密算法:输入英文字母,小写英文字母,加密向左移31位(-31),即a-->B, y-->Z, z替换A;
大写英文字母,加密向右移动33位(+33),即Z替换a, A->b,...,Y-->z
数字:向移动一位,即0-->1, 1-->2,...,8-->9, 9替换0
*/
string EncryptAlgorithm(string strInPlaintext)
{
int strLen = strInPlaintext.length();
string strOut;
for(int i = 0; i < strLen; i++) {
if(strInPlaintext[i] >= 'a' && strInPlaintext[i] <= 'z') {
if(strInPlaintext[i] == 'z') {
strOut += 'A';
} else {
strOut += strInPlaintext[i] - 31;
}
}
if(strInPlaintext[i] >= 'A' && strInPlaintext[i] <= 'Z') {
if(strInPlaintext[i] == 'Z') {
strOut += 'a';
} else {
strOut += strInPlaintext[i] + 33;
}
}
if(strInPlaintext[i] >= '0' && strInPlaintext[i] <= '9') {
if(strInPlaintext[i] == '9') {
strOut += '0';
} else {
strOut += strInPlaintext[i] + 1;
}
}
}
return strOut;
}
/*
解密:
输入大写英文字母,解密右移31位(+31) ,B-->a, C-->b,...,Z-->y,A替换z
小写英文字母,解密左移33位,a替换Z,b-->A,c-->B,...,z-->Y
数字,解密左移1-->0,2-->1,...,9-->8,0替换9
*/
string DecryptAlgorithm(string strInCiphertext)
{
int strLen = strInCiphertext.length();
string strOut;
for(int i = 0; i < strLen; i++) {
if(strInCiphertext[i] >= 'A' && strInCiphertext[i] <= 'Z') {
if(strInCiphertext[i] == 'A') {
strOut += 'z';
} else {
strOut += strInCiphertext[i] + 31;
}
}
if(strInCiphertext[i] >= 'a' && strInCiphertext[i] <= 'z') {
if(strInCiphertext[i] == 'a') {
strOut += 'Z';
} else {
strOut += strInCiphertext[i] - 33;
}
}
if(strInCiphertext[i] >= '0' && strInCiphertext[i] <= '9') {
if(strInCiphertext[i] == '0') {
strOut += '9';
} else {
strOut += strInCiphertext[i] - 1;
}
}
}
return strOut;
}
int main()
{
string strInPlaintext;
string strInCiphertext;
while(cin>>strInPlaintext>>strInCiphertext) {
cout<<EncryptAlgorithm(strInPlaintext)<<endl;
cout<<DecryptAlgorithm(strInCiphertext)<<endl;
}
}