program Hoidap247;
function tong(n: Integer): Integer;
var
digit, sum: Integer;
begin
sum := 0;
while n > 0 do
begin
digit := n mod 10;
sum := sum + digit;
n := n div 10;
end;
tong := sum;
end;
procedure ans(a, b: Integer);
var
sumA, sumB: Integer;
begin
sumA := tong(a);
sumB := tong(b);
if sumA > sumB then
WriteLn(a, ' ngon hơn ', b)
else if sumA < sumB then
WriteLn(b, ' ngon hơnn ', a)
else
begin
if a < b then
WriteLn(a, ' ngon hơn ', b)
else
WriteLn(b, ' ngon hơn ', a);
end;
end;
var
numA, numB: Integer;
begin
ReadLn(numA);
ReadLn(numB);
ans(numA, numB);
end.