Let d1 = gcd(a, b). Then d = gcd(a, b, c) = gcd(d1, c). There exist x1, y1 such that x1 * a + y1 * b = d1, and there exist x2, y2 such that x2 * d1 + y2 * c = d. Substituting d1 from the second last equation, you can express d as a linear combination of a, b, c.