"""simple docstring"""







def   __lowerCAmelCase(		__UpperCAmelCase      ):






	"""simple docstring"""





	return -num if num < 0 else num


def   __lowerCAmelCase(		__UpperCAmelCase      ):






	"""simple docstring"""





	if len(__UpperCAmelCase      ) == 0:
		raise ValueError('abs_min() arg is an empty sequence'      )
	_lowercase			:     Union[str, Any]      					=				x[0]
	for i in x:
		if abs_val(__UpperCAmelCase      ) < abs_val(__UpperCAmelCase      ):
			_lowercase			:     Optional[int]      					=				i
	return j


def   __lowerCAmelCase(		__UpperCAmelCase      ):






	"""simple docstring"""





	if len(__UpperCAmelCase      ) == 0:
		raise ValueError('abs_max() arg is an empty sequence'      )
	_lowercase			:     Any      					=				x[0]
	for i in x:
		if abs(__UpperCAmelCase      ) > abs(__UpperCAmelCase      ):
			_lowercase			:     Optional[Any]      					=				i
	return j


def   __lowerCAmelCase(		__UpperCAmelCase      ):






	"""simple docstring"""





	if len(__UpperCAmelCase      ) == 0:
		raise ValueError('abs_max_sort() arg is an empty sequence'      )
	return sorted(__UpperCAmelCase  ,key=__UpperCAmelCase      )[-1]


def   __lowerCAmelCase(		):






	"""simple docstring"""





	assert abs_val(0      ) == 0
	assert abs_val(34      ) == 34
	assert abs_val(-100_000_000_000      ) == 100_000_000_000

	_lowercase			:     List[str]      					=				[-3, -1, 2, -11]
	assert abs_max(__UpperCAmelCase      ) == -11
	assert abs_max_sort(__UpperCAmelCase      ) == -11
	assert abs_min(__UpperCAmelCase      ) == -1


if __name__ == "__main__":
						import doctest

						doctest.testmod()

						test_abs_val()
						print(abs_val(-34))  # --> 34




"""simple docstring"""







from __future__ import annotations

import math
import random


def   __lowerCAmelCase(		__UpperCAmelCase  ,__UpperCAmelCase  ,__UpperCAmelCase      ):






	"""simple docstring"""





	_lowercase			:     Optional[int]      					=				d * e - 1
	_lowercase			:     int      					=				0
	_lowercase			:     Union[str, Any]      					=				0
	while p == 0:
		_lowercase			:     int      					=				random.randint(2  ,n - 1      )
		_lowercase			:     str      					=				k
		while True:
			if t % 2 == 0:
				_lowercase			:     List[Any]      					=				t // 2
				_lowercase			:     int      					=				(g**t) % n
				_lowercase			:     Tuple      					=				math.gcd(x - 1  ,__UpperCAmelCase      )
				if x > 1 and y > 1:
					_lowercase			:     List[str]      					=				y
					_lowercase			:     str      					=				n // y
					break  # find the correct factors
			else:
				break  # t is not divisible by 2, break and choose another g
	return sorted([p, q]      )


if __name__ == "__main__":
						import doctest

						doctest.testmod()



