Forks of Euclid algorithm