t={[""]=0,["A"]=10}while""do a,b=io.read():match"(.*) (.*)"s=""y=0 for i=1,4 do c=a:sub(-i,-i)d=b:sub(-i, -i)x=y+(t[c]or c)+(t[d]or d)y=(x-1)/10 y=math.max(0,y-y%1)x=x-10*y s=(({"",[11]="A"})[1+x]or x)..s end print(s)end