
"""simple docstring"""







from __future__ import annotations
def    __lowerCAmelCase    (_UpperCamelCase	,  _UpperCamelCase		):
	__lowerCAmelCase      :						list[list[int]]						      =				[]
	create_all_state(1	,  _UpperCamelCase	,  _UpperCamelCase	,  []	,  _UpperCamelCase		)
	return result
def    __lowerCAmelCase    (_UpperCamelCase	,  _UpperCamelCase	,  _UpperCamelCase	,  _UpperCamelCase	,  _UpperCamelCase	,  ):
	if level == 0:
		total_list.append(current_list[:]		)
		return

	for i in range(_UpperCamelCase	,  total_number - level + 2		):
		current_list.append(_UpperCamelCase		)
		create_all_state(i + 1	,  _UpperCamelCase	,  level - 1	,  _UpperCamelCase	,  _UpperCamelCase		)
		current_list.pop()
def    __lowerCAmelCase    (_UpperCamelCase		):
	for i in total_list:
		print(*_UpperCamelCase		)


if __name__ == "__main__":
							lowerCamelCase__        =		4
							lowerCamelCase__        =		2
							lowerCamelCase__        =		generate_all_combinations(n, k)
							print_all_state(total_list)

"""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()