


def       lowercase_		(		_A			:    list						):

      """simple docstring"""




      if any(not isinstance(_A    ,					_A						) or x < 0 for x in sequence						):
            raise TypeError("Sequence must be list of non-negative integers"						)
      for _ in range(len(_A						)						):
            for i, (rod_upper, rod_lower) in enumerate(zip(_A    ,					sequence[1:]						)						):
                  if rod_upper > rod_lower:
                        sequence[i] -= rod_upper - rod_lower
                        sequence[i + 1] += rod_upper - rod_lower
      return sequence


if __name__ == "__main__":
    assert bead_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]
    assert bead_sort([7, 9, 4, 3, 5]) == [3, 4, 5, 7, 9]






def       lowercase_		(		_A			:    int    ,					_A			:    int						):

      """simple docstring"""




      while a != 0:
            lowerCamelCase__    ,   lowerCamelCase__		:				Optional[Any]    =  b % a, a
      return b


def       lowercase_		(		_A			:    int    ,					_A			:    int						):

      """simple docstring"""




      if gcd(_A    ,					_A						) != 1:
            lowerCamelCase__		:				List[str]    =  F"mod inverse of {a!r} and {m!r} does not exist"
            raise ValueError(_A						)
      lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__		:				Tuple    =  1, 0, a
      lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__		:				Optional[int]    =  0, 1, m
      while va != 0:
            lowerCamelCase__		:				Tuple    =  ua // va
            lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__		:				str    =  (ua - q * va), (ua - q * va), (ua - q * va), va, va, va
      return ua % m


