#include using namespace std; char jog(char x,char y) { if(x=='0') return y; else if(y=='0') return x; else if(x=='V') return y; else if(y=='V') return x; else if(x=='U'&&y=='U') return 'C'; else if(x=='C'&& y=='C') return 'V'; else if(x=='U'&&y=='C'||x=='C'&& y=='U') return 'D'; else if(x=='C'&&y=='D'||x=='D'&& y=='C') return 'U'; else if(x=='U'&&y=='D'||x=='D'&& y=='U') return 'V'; } char carry(char x,char y) { if(x=='U'&&y=='D'||x=='D'&&y=='U') return 'U'; else if(x=='C'&& y=='C') return 'U'; else if(x=='D'&& y=='D') return 'U'; else if(x=='C'&&y=='D'||x=='D'&&y=='C') return 'U'; else return '0'; } int main() { freopen("in.txt","r",stdin); freopen("out.txt","w",stdout); int t,i,j,k,l1,l2; string s1,s2,s3,ans; cin>>t; cout<<"COWCULATIONS OUTPUT"<>s1>>s2; char c,num1,num2,num3,pre='0',carry1,carry2; // string ans=""; for(j=1;j<=3;j++) { cin>>c; if(c=='A') { l1=s1.length()-1,l2=s2.length()-1; string res=""; for(i=l1;i>=0;i--) { num1=jog(s1[i],s2[l2]); carry1=carry(s1[i],s2[l2]); num2=jog(num1,pre); carry2=carry(num1,pre); res+=num2; // cout<<"vitore ans1 "<=0) { num1=jog(s2[l2],pre); carry1=carry(s2[l2],pre); res+=num1; // cout<<"vitore ans2 "<>s3; if(s3==s2) cout<<"YES"<