uses crt;
var m,n,t1,t2,i,j:integer;
begin
clrscr;
write('n='); readln(n);
write('m='); readln(m);
t1:=0;
t2:=0;
for i:=2 to n-1 do
if n mod i=0 then t1:=t1+i;
for j:=2 to m-1 do
if m mod j=0 then t2:=t2+j;
if t1=t2 then writeln(n,' va ',m,' la hai so anh em')
else writeln(n,' va ',m,' khong la hai so anh em');
readln;
end.