Implemented Euclid problem.