gcd using Euclid method