class  __lowerCAmelCase	:



 '''simple docstring'''




 class  __lowerCAmelCase	:



  '''simple docstring'''
  _lowerCamelCase    :						Tuple					     =			'_prev', '_data', '_next'

  def __init__(      self							:		int							,      lowerCamelCase							:		List[Any]							,      lowerCamelCase							:		Any							,      lowerCamelCase							:		Union[str, Any]	)			->				List[Any]:
         _UpperCamelCase  :							str	    =	link_p
         _UpperCamelCase  :							Union[str, Any]	    =	element
         _UpperCamelCase  :							Tuple	    =	link_n

  def        __snake_case       (      self							:		Optional[int]	)			->				Optional[int]:
         return (
             f" Prev -> {self._prev is not None}, Next -> {self._next is not None}"
         )







 def __init__(      self							:		Optional[Any]	)			->				Union[str, Any]:
        _UpperCamelCase  :							int	    =	self._Node(lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase	)
        _UpperCamelCase  :							str	    =	self._Node(lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase	)
        _UpperCamelCase  :							List[Any]	    =	self._trailer
        _UpperCamelCase  :							List[Any]	    =	self._header
        _UpperCamelCase  :							Dict	    =	0

 def __len__(      self							:		List[str]	)			->				str:
        return self._size

 def        __snake_case       (      self							:		Dict	)			->				Union[str, Any]:
        return self.__len__() == 0

 def        __snake_case       (      self							:		Any							,      lowerCamelCase							:		str							,      lowerCamelCase							:		Any							,      lowerCamelCase							:		Union[str, Any]	)			->				Optional[Any]:
        # Create new_node by setting it's prev.link -> header
        # setting it's next.link -> trailer
        _UpperCamelCase  :							List[Any]	    =	self._Node(lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase	)
        _UpperCamelCase  :							Tuple	    =	new_node
        _UpperCamelCase  :							Tuple	    =	new_node
        self._size += 1
        return self

 def        __snake_case       (      self							:		int							,      lowerCamelCase							:		Any	)			->				Union[str, Any]:
        _UpperCamelCase  :							int	    =	node._prev
        _UpperCamelCase  :							List[Any]	    =	node._next

        _UpperCamelCase  :							Any	    =	successor
        _UpperCamelCase  :							Dict	    =	predecessor
        self._size -= 1
        _UpperCamelCase  :							int	    =	node._data
        _UpperCamelCase  :							Tuple	    =	None
        del node
        return temp







class  __lowerCAmelCase	(							_DoublyLinkedBase    ):



 '''simple docstring'''

 def        __snake_case       (      self							:		List[str]	)			->				Optional[int]:
        if self.is_empty():
               raise Exception('List is empty'	)
        return self._header._next._data

 def        __snake_case       (      self							:		Optional[int]	)			->				List[str]:
        if self.is_empty():
               raise Exception('List is empty'	)
        return self._trailer._prev._data

 def        __snake_case       (      self							:		List[Any]							,      lowerCamelCase							:		List[Any]	)			->				int:
        return self._insert(self._header							,      lowerCamelCase							,      self._header._next	)

 def        __snake_case       (      self							:		Tuple							,      lowerCamelCase							:		Tuple	)			->				Any:
        return self._insert(self._trailer._prev							,      lowerCamelCase							,      self._trailer	)

 def        __snake_case       (      self							:		int	)			->				Dict:
        if self.is_empty():
               raise IndexError('remove_first from empty list'	)
        return self._delete(self._header._next	)

 def        __snake_case       (      self							:		Any	)			->				str:
        if self.is_empty():
               raise IndexError('remove_first from empty list'	)
        return self._delete(self._trailer._prev	)








def 	_A	(   _UpperCamelCase			):
				if not isinstance(_UpperCamelCase      ,					_UpperCamelCase			):
								_UpperCAmelCase						:  List[Any]     					=	(
								    '''operation can not be conducted on a object of type '''
								    F'''{type(_UpperCamelCase			).__name__}'''
								)
								raise TypeError(_UpperCamelCase			)
				_UpperCAmelCase						:  List[str]     					=	''''''
				for _ in range(0      ,					32			):
								bit_string += str(number % 2			)
								_UpperCAmelCase						:  Union[str, Any]     					=	number >> 1
				return bit_string


def 	_A	(   _UpperCamelCase			):
				if number < 0:
								raise ValueError('''the value of input must be positive'''			)
				elif isinstance(_UpperCamelCase      ,					_UpperCamelCase			):
								raise TypeError('''Input value must be a \'int\' type'''			)
				elif isinstance(_UpperCamelCase      ,					_UpperCamelCase			):
								raise TypeError('''\'<\' not supported between instances of \'str\' and \'int\''''			)
				_UpperCAmelCase						:  Tuple     					=	0
				# iterator over [1 to 32],since we are dealing with 32 bit integer
				for _ in range(1      ,					33			):
								# left shift the bits by unity
								_UpperCAmelCase						:  List[str]     					=	result << 1
								# get the end bit
								_UpperCAmelCase						:  List[Any]     					=	number % 2
								# right shift the bits by unity
								_UpperCAmelCase						:  Optional[int]     					=	number >> 1
								# add that bit to our ans
								_UpperCAmelCase						:  Any     					=	result | end_bit
				return get_reverse_bit_string(_UpperCamelCase			)


if __name__ == "__main__":
					import doctest

					doctest.testmod()
