from typing import Tuple


def extended_euclidean(x: int, y: int) -> Tuple[int, int, int]:
    """
    See:
    shainer.github.io/crypto/math/2017/10/22/chinese-remainder-theorem.html

    Given two integers, returns their greatest common denominator and
    the two coefficients in the Bézout identity.
    """
    x0, x1, y0, y1 = 1, 0, 0, 1

    while y > 0:
        q, x, y = x // y, y, x % y
        x0, x1 = x1, x0 - (q * x1)
        y0, y1 = y1, y0 - (q * y1)

    return x, x0, y0