Euclidean Algorithm on the Tech Tree