#include<stdio.h>
main()
{
	long int X,Y,ax,ay,i=1,z=0;
	
	printf("Unesi X:");
	scanf("%d",&X);
	printf("Unesi Y:");
	scanf("%d",&Y);
	
	if(X==0 && Y==0)
	{
		printf("Greska! Unili ste nule.");
	}
		while(X!=0 || Y!=0)
		{
			ax=X%10;
			ay=Y%10;
			if(ax>ay)
			{
				z=ax*i+z;
			}
			else if(ay>ax)
			{
				z=ay*i+z;
			}
			else if(ax=ay)
			{
				z=ax*i+ay*i*10+z;
				i=i*10;
			}
			X=X/10;
			Y=Y/10;
			i=i*10;
		}
	printf("%d",z);
}