#include<bits/stdc++.h>
using namespace std;
int main() {
string a,b,answer;
cin>>a>>b;
reverse(a.begin(),a.end());
reverse(b.begin(),b.end());
int n=a.size(),m=b.size();
int L=max(n,m);
for(int i=0;i<L;i++){
int num1=i<n?a[i]-'0':0;
int num2=i<m?b[i]-'0':0;
if(i%2==0){
if((num1+num2)%13==10) answer+='J';
else if((num1+num2)%13==11) answer+='Q';
else if((num1+num2)%13==12) answer+='K';
else answer+=(num1+num2)%13+'0';
}
else{
if(num1>num2){
answer+=(num2-num1)+10+'0';
}else answer+=(num2-num1)+'0';
}
}
reverse(answer.begin(),answer.end());
cout<<answer<<endl;
return 0;
}