bellmann ford, gcd, lcm, ectended euclid