Extended Euclidean Algorithm (Solved Example 1)