#include <bits/stdc++.h>
using namespace std;
    string x,y,s,s1;
    int a,b;
int main(){
    cin >> x >> y;
    a=x.size();
    b=y.size();
    if(a>b){
        s1=x;
        x=y;
        y=s1;
    }
    reverse(x.begin(),x.end());
    for(int i=0; i<a-b; i++){
        x.push_back('0');
    }
    reverse(x.begin(),x.end());
    cout << x << endl << y << endl;
    for(int i=0; i<=a; i++){
        if(x[i]>y[i]){s+=x[i];}
        else if(x[i]==y[i]){s+=x[i]; s+=x[i];}
        else if(x[i]<y[i]){s+=y[i];}
    }
    cout << s << endl;
    return 0;
}