var a,b,i,nda,ndb:integer;
begin
readln(a,b);
nda := 0;
ndb := 0;
for i := 1 to a do
if (a mod i = 0) then inc(nda);
for i := 1 to b do
if (b mod i = 0) then inc(ndb);
if (nda > ndb) then
writeln(a, ' has more divisors than ', b)
else if (ndb > nda) then
writeln(b, ' has more divisors than ', a)
else
writeln(a, ' and', b, ' has equal number of divisors')
end.