extended euclid