#include<iostream>
using namespace std;
int main()
{
	long long int x,y,n=0, z=0;
	int temp=1, temp1=0, temp2=0;
	cin>>x>>y;
	if(y>x)
	{
		z=y;
		y=x;
		x=z;
	}
	while(x!=0 || y!=0)
	{
    temp1 = x%10;
	temp2 = y%10;
	if(y==0)
	{
		n=n+temp1*temp;
	}
	else if(temp1>temp2)
	{
		n=n+temp1*temp;
	}
	else if(temp1==temp2)
	{
		n=n+temp1*temp*10+temp2*temp;
		temp=temp*10;
	}
    else
    {
    	n=n+temp2*temp;
	}
    x=x/10;
    y=y/10;
    temp=temp*10;
	}
	cout<<n<<endl;
}