
"""simple docstring"""







def    __lowerCAmelCase    (_UpperCamelCase	,  _UpperCamelCase		):
	if number < 0 or shift_amount < 0:
		raise ValueError('both inputs must be positive integers'		)

	__lowerCAmelCase      :						Dict						      =				str(bin(_UpperCamelCase		)		)
	binary_number += "0" * shift_amount
	return binary_number
def    __lowerCAmelCase    (_UpperCamelCase	,  _UpperCamelCase		):
	if number < 0 or shift_amount < 0:
		raise ValueError('both inputs must be positive integers'		)

	__lowerCAmelCase      :						List[Any]						      =				str(bin(_UpperCamelCase		)		)[2:]
	if shift_amount >= len(_UpperCamelCase		):
		return "0b0"
	__lowerCAmelCase      :						Optional[Any]						      =				binary_number[: len(_UpperCamelCase		) - shift_amount]
	return "0b" + shifted_binary_number
def    __lowerCAmelCase    (_UpperCamelCase	,  _UpperCamelCase		):
	if number >= 0:  # Get binary representation of positive number
		__lowerCAmelCase      :						Optional[Any]						      =				'0' + str(bin(_UpperCamelCase		)		).strip('-'		)[2:]
	else:  # Get binary (2's complement) representation of negative number
		__lowerCAmelCase      :						List[str]						      =				len(bin(_UpperCamelCase		)[3:]		)  # Find 2's complement of number
		__lowerCAmelCase      :						str						      =				bin(abs(_UpperCamelCase		) - (1 << binary_number_length)		)[3:]
		__lowerCAmelCase      :						List[str]						      =				(
		    '1' + '0' * (binary_number_length - len(_UpperCamelCase		)) + binary_number
		)

	if shift_amount >= len(_UpperCamelCase		):
		return "0b" + binary_number[0] * len(_UpperCamelCase		)
	return (
	    "0b"
	    + binary_number[0] * shift_amount
	    + binary_number[: len(_UpperCamelCase		) - shift_amount]
	)


if __name__ == "__main__":
							import doctest

							doctest.testmod()

"""simple docstring"""







class 			A__	:

		def __init__(				self	,		_SCREAMING_SNAKE_CASE			):
			__lowerCAmelCase      :						List[Any]						      =				size
			__lowerCAmelCase      :						str						      =				[0] * size
			__lowerCAmelCase      :						Any						      =				[0] * size

		@staticmethod
		def 							__lowerCamelCase							(				_SCREAMING_SNAKE_CASE			):
			return index | (index + 1)

		@staticmethod
		def 							__lowerCamelCase							(				_SCREAMING_SNAKE_CASE			):
			return (index & (index + 1)) - 1

		def 							__lowerCamelCase							(				self	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE			):
			__lowerCAmelCase      :						Any						      =				value
			while index < self.size:
				__lowerCAmelCase      :						Dict						      =				self.get_prev(_SCREAMING_SNAKE_CASE			) + 1
				if current_left_border == index:
					__lowerCAmelCase      :						Any						      =				value
				else:
					__lowerCAmelCase      :						Any						      =				max(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE			)
				__lowerCAmelCase      :						List[Any]						      =				self.get_next(_SCREAMING_SNAKE_CASE			)







		def 							__lowerCamelCase							(				self	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE			):
			right -= 1  # Because of right is exclusive
			__lowerCAmelCase      :						Optional[int]						      =				0
			while left <= right:
				__lowerCAmelCase      :						Optional[int]						      =				self.get_prev(_SCREAMING_SNAKE_CASE			)
				if left <= current_left:
					__lowerCAmelCase      :						Optional[Any]						      =				max(_SCREAMING_SNAKE_CASE	,		self.tree[right]			)
					__lowerCAmelCase      :						Optional[Any]						      =				current_left
				else:
					__lowerCAmelCase      :						List[str]						      =				max(_SCREAMING_SNAKE_CASE	,		self.arr[right]			)
					right -= 1
			return result


if __name__ == "__main__":
							import doctest

							doctest.testmod()