

"""simple docstring"""







from __future__ import annotations
def   __UpperCAmelCase    (   UpperCAmelCase_   :    list  )							->      list:

	'''simple docstring'''





	if len(UpperCAmelCase_  ) == 0:
		return []
	__snake_case      :							List[Any]						=			min(UpperCAmelCase_  ), max(UpperCAmelCase_  )
	__snake_case      :							str						=			int(max_value - min_value  ) + 1
	__snake_case      :							list[list]						=			[[] for _ in range(UpperCAmelCase_  )]

	for i in my_list:
		buckets[int(i - min_value  )].append(UpperCAmelCase_  )

	return [v for bucket in buckets for v in sorted(UpperCAmelCase_  )]


if __name__ == "__main__":
	from doctest import testmod

	testmod()
	assert bucket_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
	assert bucket_sort([0, 1, -10, 15, 2, -2]) == [-10, -2, 0, 1, 2, 15]






"""simple docstring"""







def   __UpperCAmelCase    (   UpperCAmelCase_   :    int      ,							UpperCAmelCase_   :    int  )							->      int:

	'''simple docstring'''





	while a != 0:
		__snake_case		,    __snake_case      :							Union[str, Any]						=			b % a, a
	return b

def   __UpperCAmelCase    (   UpperCAmelCase_   :    int      ,							UpperCAmelCase_   :    int  )							->      int:

	'''simple docstring'''





	if gcd(UpperCAmelCase_      ,							UpperCAmelCase_  ) != 1:
		__snake_case      :							Union[str, Any]						=			F"mod inverse of {a!r} and {m!r} does not exist"
		raise ValueError(UpperCAmelCase_  )
	__snake_case		,    __snake_case		,    __snake_case      :							List[str]						=			1, 0, a
	__snake_case		,    __snake_case		,    __snake_case      :							Dict						=			0, 1, m
	while va != 0:
		__snake_case      :							List[str]						=			ua // va
		__snake_case		,    __snake_case		,    __snake_case		,    __snake_case		,    __snake_case		,    __snake_case      :							List[str]						=			(ua - q * va), (ua - q * va), (ua - q * va), va, va, va
	return ua % m





