using System;

namespace Zad1
{
	class Program
	{
		static void Main()
		{
			int a = int.Parse(Console.ReadLine());
			int b = int.Parse(Console.ReadLine());
			int c1 = a % 10;
			int c2 = b % 10;
			a = a / 10;
			b = b / 10;
			int i = 0;
			int n = 0;
			while(c1 != 0 || c2 != 0 || a > 0 || b > 0)
			{
				if(c1 == c2)
				{
					if (!(c1 == 0 && (a == 0 || b == 0)))
					{
						n += (int)Math.Pow(10, i) * c1;
						i++;
						n += (int)Math.Pow(10, i) * c1;
					}
				}
				else if(c1 > c2)
				{
					n += (int)Math.Pow(10, i) * c1;
				}
				else
				{
					n += (int)Math.Pow(10, i) * c2;
				}
				i++;
				c1 = a % 10;
				c2 = b % 10;
				a = a / 10;
				b = b / 10;
			}
			Console.WriteLine(n);
		}
	}
}