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