

'''simple docstring'''
from __future__ import annotations

import sys


def  _lowerCAmelCase      (		_UpperCamelCase		:  int							,				_UpperCamelCase		:  int       )   ->    tuple[int, int]:
     """simple docstring"""




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

     _SCREAMING_SNAKE_CASE					,		_SCREAMING_SNAKE_CASE												=a, b
     _SCREAMING_SNAKE_CASE					,		_SCREAMING_SNAKE_CASE												=1, 0
     _SCREAMING_SNAKE_CASE					,		_SCREAMING_SNAKE_CASE												=0, 1

     while remainder != 0:
          _SCREAMING_SNAKE_CASE												=old_remainder // remainder
          _SCREAMING_SNAKE_CASE					,		_SCREAMING_SNAKE_CASE												=remainder, old_remainder - quotient * remainder
          _SCREAMING_SNAKE_CASE					,		_SCREAMING_SNAKE_CASE												=coeff_a, old_coeff_a - quotient * coeff_a
          _SCREAMING_SNAKE_CASE					,		_SCREAMING_SNAKE_CASE												=coeff_b, old_coeff_b - quotient * coeff_b

     # sign correction for negative numbers
     if a < 0:
          _SCREAMING_SNAKE_CASE												=-old_coeff_a
     if b < 0:
          _SCREAMING_SNAKE_CASE												=-old_coeff_b

     return old_coeff_a, old_coeff_b


def  _lowerCAmelCase      (		)   ->    Union[str, Any]:
     """simple docstring"""




     if len(sys.argv       ) < 3:
          print('2 integer arguments required'       )
          return 1
     _SCREAMING_SNAKE_CASE												=int(sys.argv[1]       )
     _SCREAMING_SNAKE_CASE												=int(sys.argv[2]       )
     print(extended_euclidean_algorithm(_UpperCamelCase							,				_UpperCamelCase       )       )
     return 0


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



'''simple docstring'''
lowerCamelCase				:   int      				=  {
    0: "underwear",
    1: "pants",
    2: "belt",
    3: "suit",
    4: "shoe",
    5: "socks",
    6: "shirt",
    7: "tie",
    8: "watch",
}

lowerCamelCase				:   Union[str, Any]      				=  [[1, 4], [2, 4], [3], [], [], [4], [2, 7], [3], []]

lowerCamelCase				:   int      				=  [0 for x in range(len(graph))]
lowerCamelCase				:   Optional[Any]      				=  []


def  _lowerCAmelCase      (		_UpperCamelCase		:  List[str]							,				_UpperCamelCase		:  Union[str, Any]       )   ->    Union[str, Any]:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE												=1
     while stack:
          _SCREAMING_SNAKE_CASE												=stack.pop()
          print(_UpperCamelCase							,				clothes[current_clothing]       )
          order += 1


def  _lowerCAmelCase      (		_UpperCamelCase		:  str							,				_UpperCamelCase		:  Optional[Any]							,				_UpperCamelCase		:  Dict       )   ->    Optional[Any]:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE												=1
     for v in graph[u]:
          if not visited[v]:
               depth_first_search(_UpperCamelCase							,				_UpperCamelCase							,				_UpperCamelCase       )

     stack.append(_UpperCamelCase       )


def  _lowerCAmelCase      (		_UpperCamelCase		:  Dict							,				_UpperCamelCase		:  List[str]       )   ->    Optional[int]:
     """simple docstring"""




     for v in range(len(_UpperCamelCase       )       ):
          if not visited[v]:
               depth_first_search(_UpperCamelCase							,				_UpperCamelCase							,				_UpperCamelCase       )


if __name__ == "__main__":
     topological_sort(graph, visited)
     print(stack)
     print_stack(stack, clothes)
