

def    __UpperCAmelCase (	__a      :			List[str]	)			->     Optional[Any]:

					"""simple docstring"""

					if isinstance(_UpperCAmelCase		,_UpperCAmelCase	):
										raise TypeError('''\'float\' object cannot be interpreted as an integer'''	)
					if isinstance(_UpperCAmelCase		,_UpperCAmelCase	):
										raise TypeError('''\'str\' object cannot be interpreted as an integer'''	)

					if num == 0:
										return "0b0"

					_a	:    str         =		False

					if num < 0:
										_a	:    Dict         =		True
										_a	:    Union[str, Any]         =		-num

					_a	:    list[int]         =		[]
					while num > 0:
										binary.insert(0		,num % 2	)
										num >>= 1

					if negative:
										return "-0b" + "".join(str(_UpperCAmelCase	) for e in binary	)

					return "0b" + "".join(str(_UpperCAmelCase	) for e in binary	)


if __name__ == "__main__":
			import doctest

			doctest.testmod()










"""simple docstring"""




from copy import deepcopy

class  _UpperCAmelCase  :



      '''simple docstring'''

      def __init__(     self					,      snake_case_ = None					,      snake_case_ = None  ):

        """simple docstring"""

        if arr is None and size is not None:
          A_  :       Union[str, Any]										=  size
          A_  :       List[str]										=  [0] * size
        elif arr is not None:
          self.init(snake_case_  )
        else:
          raise ValueError('Either arr or size must be specified'  )

      def 					lowerCamelCase_			(     self					,      snake_case_  ):

        """simple docstring"""

        A_  :       Union[str, Any]										=  len(snake_case_  )
        A_  :       Optional[int]										=  deepcopy(snake_case_  )
        for i in range(1					,      self.size  ):
          A_  :       Optional[Any]										=  self.next_(snake_case_  )
          if j < self.size:
            self.tree[j] += self.tree[i]

      def 					lowerCamelCase_			(     self  ):

        """simple docstring"""

        A_  :       int										=  self.tree[:]
        for i in range(self.size - 1					,      0					,      -1  ):
          A_  :       Optional[int]										=  self.next_(snake_case_  )
          if j < self.size:
            arr[j] -= arr[i]
        return arr

      @staticmethod
      def 					lowerCamelCase_			(     snake_case_  ):

        """simple docstring"""

        return index + (index & (-index))

      @staticmethod
      def 					lowerCamelCase_			(     snake_case_  ):

        """simple docstring"""

        return index - (index & (-index))

      def 					lowerCamelCase_			(     self					,      snake_case_					,      snake_case_  ):

        """simple docstring"""

        if index == 0:
          self.tree[0] += value
          return
        while index < self.size:
          self.tree[index] += value
          A_  :       List[str]										=  self.next_(snake_case_  )

      def 					lowerCamelCase_			(     self					,      snake_case_					,      snake_case_  ):

        """simple docstring"""

        self.add(snake_case_					,      value - self.get(snake_case_  )  )

      def 					lowerCamelCase_			(     self					,      snake_case_  ):

        """simple docstring"""

        if right == 0:
          return 0
        A_  :       Any										=  self.tree[0]
        right -= 1  # make right inclusive
        while right > 0:
          result += self.tree[right]
          A_  :       Tuple										=  self.prev(snake_case_  )
        return result

      def 					lowerCamelCase_			(     self					,      snake_case_					,      snake_case_  ):

        """simple docstring"""

        return self.prefix(snake_case_  ) - self.prefix(snake_case_  )

      def 					lowerCamelCase_			(     self					,      snake_case_  ):

        """simple docstring"""

        return self.query(snake_case_					,      index + 1  )

      def 					lowerCamelCase_			(     self					,      snake_case_  ):

        """simple docstring"""

        value -= self.tree[0]
        if value < 0:
          return -1

        A_  :       List[Any]										=  1  # Largest power of 2 <= size
        while j * 2 < self.size:
          j *= 2

        A_  :       Tuple										=  0

        while j > 0:
          if i + j < self.size and self.tree[i + j] <= value:
            value -= self.tree[i + j]
            i += j
          j //= 2
        return i


if __name__ == "__main__":
   import doctest

   doctest.testmod()