using System;
					
public class Program
{
	public static void Main()
	{
		string a = "";
		int X = int.Parse(Console.ReadLine());
        int Y = int.Parse(Console.ReadLine());
        string x1 = Convert.ToString(X);
        string y1 = Convert.ToString(Y);
		int x2 = x1.Length;
		int y2 = y1.Length;
		int d = Math.Min(x2, y2);
		string d1 = Convert.ToString(d);
		int d2 = d1.Length;
		if (x2 > y2){
			for (int i = 0; i < x2 - y2; i++) {
				a =a+x1[i];
			}
		}
		else {
			for (int i = 0; i < y2 - x2; i++) {
				a = a+y1[i];
			}
		}
		int raz = Math.Abs(x2-y2);
		for (int c = 0; c < d; c ++){
			if (x2 > y2) {
				if (x1[c + raz] > y1[c]) {
					a = a + x1[c + raz]; 
				}
				else if (x1[c + raz] < y1[c]) {
					a = a + y1[c];
				}
				else {
					a = a + y1[c] + y1[c];
				}
			}
			else {
				if (y1[c + raz] > x1[c]) {
					a = a + y1[c + raz]; 
				}
				else if (y1[c + raz] < x1[c]) {
					a = a + x1[c];
				}
				else {
					a = a + x1[c] + x1[c];
				}
			}
		}
		long a1 = Convert.ToInt64(a);
		Console.WriteLine(a1);
        Console.ReadLine();
	}
}