def euclidean(N: int, a: int) -> int:
    """
    Uses the Euclidean Algorithm to calculate the GCD of `N` and `a`.
    """
    remainder = N % a
    if remainder == 0:
        return a
    return euclidean(a, remainder)