






"""simple docstring"""





from __future__ import annotations

import sys






def 							A(    snake_case_		,  snake_case_						):
       """simple docstring"""





       if abs(__A						) == 1:
              return a, 0
       elif abs(__A						) == 1:
              return 0, b

       lowercase__    ,      lowercase__:							int         =     a, b
       lowercase__    ,      lowercase__:							Dict         =     1, 0
       lowercase__    ,      lowercase__:							Tuple         =     0, 1

       while remainder != 0:
              lowercase__:							int         =     old_remainder // remainder
              lowercase__    ,      lowercase__:							Dict         =     remainder, old_remainder - quotient * remainder
              lowercase__    ,      lowercase__:							Union[str, Any]         =     coeff_a, old_coeff_a - quotient * coeff_a
              lowercase__    ,      lowercase__:							Tuple         =     coeff_b, old_coeff_b - quotient * coeff_b

       # sign correction for negative numbers
       if a < 0:
              lowercase__:							Optional[int]         =     -old_coeff_a
       if b < 0:
              lowercase__:							int         =     -old_coeff_b

       return old_coeff_a, old_coeff_b






def 							A(    ):
       """simple docstring"""





       if len(sys.argv						) < 3:
              print("2 integer arguments required"						)
              return 1
       lowercase__:							int         =     int(sys.argv[1]						)
       lowercase__:							Any         =     int(sys.argv[2]						)
       print(extended_euclidean_algorithm(__A		,  __A						)						)
       return 0


if __name__ == "__main__":
  raise SystemExit(main())










'''simple docstring'''







import itertools







def _UpperCamelCase			(	__A = 1000000       )				->						int:


      '''simple docstring'''



      UpperCamelCase__      =							[1]

      for i in itertools.count(len(__A       )       ):
            UpperCamelCase__      =							0
            for j in itertools.count(1       ):
                  UpperCamelCase__      =							-1 if j % 2 == 0 else +1
                  UpperCamelCase__      =							(j * j * 3 - j) // 2
                  if index > i:
                        break
                  item += partitions[i - index] * sign
                  item %= number
                  index += j
                  if index > i:
                        break
                  item += partitions[i - index] * sign
                  item %= number

            if item == 0:
                  return i
            partitions.append(__A       )

      return 0


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  print(F"""{solution() = }""")





