using System;

class Zadatak
{
    static void Main()
    {
        Console.WriteLine("Unesite dva broja koja hocete sudariti:");
        int a = int.Parse(Console.ReadLine());
        int b = int.Parse(Console.ReadLine());
        int a1 = a / 100;
        int a2 = (a % 100) / 10;
        int a3 = a % 10;
        int b1 = b / 100;
        int b2 = (b % 100) / 10;
        int b3 = b % 10;
        Console.WriteLine("Broj je:");
        if (a1 > b1 && a1 != 0) Console.Write(a1);
        else if (a1 == b1 && a1+b1 != 0) { Console.Write(a1); Console.Write(b1); }
        else if (b1 > a1 && b1 != 0)Console.Write(b1);
        if (a2 > b2) Console.Write(a2);
        else if (a2 == b2 && a1+a2 != 0 && b1+b2 != 0) { Console.Write(a2); Console.Write(b2); }
        else Console.Write(b2);
        if (a3 > b3) Console.Write(a3);
        else if (a3 == b3) {Console.Write(a3); Console.Write(b3); }
        else Console.Write(b3);
    }
}