#include <iostream>
#include <string>
using namespace std;
//***********************
//查字典法加密解密
//***********************
string book_code = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string book_decode = "BCDEFGHIJKLMNOPQRSTUVWXYZA1234567890bcdefghijklmnopqrstuvwxyza";
string code(string input){
string result;
for(int i = 0;i<input.size();i++){
for(int j = 0;j<book_code.size();j++){
if(input[i]==book_code[j]){
result+=book_decode[j];
}
}
}
return result;
}
string decode(string input){
string result;
for(int i = 0;i<input.size();i++){
for(int j = 0;j<book_decode.size();j++){
if(input[i]==book_decode[j]){
result+=book_code[j];
}
}
}
return result;
}
int main(){
string str_code;
string str_decode;
while(cin>>str_code){
cin>>str_decode;
string str_result_code = code(str_code);
string str_result_decode = decode(str_decode);
cout<<str_result_code<<endl;
cout<<str_result_decode<<endl;
}
}