text: import numpy as np
  
  def Euclidean(x, y):
      a, b, ap, bp = x, y, np.array([1, 0]), np.array([0, 1])
      while True:
          d, r = a // b, a % b
          if r == 0:
              return b, bp
          a, b = b, r
          ap, bp = bp, ap - d * bp
      