gcd:=proc (m,n)
p:=m;
q:=n;
while (p <> q) and (p > 0) and ( q > 0) do
if p > q then p := p mod q;
else if q > p then q := q mod p;
fi;
fi;
od;
if ( p = 0) then q else p; fi;
end;
