euclidean algorithm paper