

class 							a__							:







  """simple docstring"""




  class 							a__							:







    """simple docstring"""




    UpperCAmelCase__   :			int      							="""_prev""", """_data""", """_next"""


    def __init__(      self     :			Optional[int]					,					UpperCAmelCase__     :			str					,					UpperCAmelCase__     :			int					,					UpperCAmelCase__     :			Any		)       ->Tuple:
          """simple docstring"""







          SCREAMING_SNAKE_CASE			:   int	  = link_p
          SCREAMING_SNAKE_CASE			:   List[Any]	  = element
          SCREAMING_SNAKE_CASE			:   Any	  = link_n




    def 			_lowercase   (      self     :			Any		)       ->List[Any]:
          """simple docstring"""







          return (
              f" Prev -> {self._prev is not None}, Next -> {self._next is not None}"
          )


  def __init__(      self     :			Optional[int]		)       ->Optional[int]:
        """simple docstring"""







        SCREAMING_SNAKE_CASE			:   Dict	  = self._Node(lowercase_					,					lowercase_					,					lowercase_		)
        SCREAMING_SNAKE_CASE			:   int	  = self._Node(lowercase_					,					lowercase_					,					lowercase_		)
        SCREAMING_SNAKE_CASE			:   Any	  = self._trailer
        SCREAMING_SNAKE_CASE			:   Optional[Any]	  = self._header
        SCREAMING_SNAKE_CASE			:   Optional[Any]	  = 0


  def __len__(      self     :			Any		)       ->Tuple:
        """simple docstring"""







        return self._size


  def 			_lowercase   (      self     :			Tuple		)       ->str:
        """simple docstring"""







        return self.__len__() == 0


  def 			_lowercase   (      self     :			Optional[int]					,					UpperCAmelCase__     :			List[Any]					,					UpperCAmelCase__     :			Optional[Any]					,					UpperCAmelCase__     :			Optional[int]		)       ->str:
        """simple docstring"""







        SCREAMING_SNAKE_CASE			:   Optional[int]	  = self._Node(lowercase_					,					lowercase_					,					lowercase_		)
        SCREAMING_SNAKE_CASE			:   Tuple	  = new_node
        SCREAMING_SNAKE_CASE			:   List[str]	  = new_node
        self._size += 1
        return self




  def 			_lowercase   (      self     :			Dict					,					UpperCAmelCase__     :			List[str]		)       ->Optional[int]:
        """simple docstring"""







        SCREAMING_SNAKE_CASE			:   Dict	  = node._prev
        SCREAMING_SNAKE_CASE			:   Union[str, Any]	  = node._next

        SCREAMING_SNAKE_CASE			:   List[Any]	  = successor
        SCREAMING_SNAKE_CASE			:   Optional[int]	  = predecessor
        self._size -= 1
        SCREAMING_SNAKE_CASE			:   Dict	  = node._data
        SCREAMING_SNAKE_CASE			:   List[str]	  = None
        del node
        return temp







class 							a__							( _DoublyLinkedBase							):







  """simple docstring"""




  def 			_lowercase   (      self     :			List[str]		)       ->Union[str, Any]:
        """simple docstring"""







        if self.is_empty():
              raise Exception("""List is empty"""		)
        return self._header._next._data


  def 			_lowercase   (      self     :			Any		)       ->Optional[Any]:
        """simple docstring"""







        if self.is_empty():
              raise Exception("""List is empty"""		)
        return self._trailer._prev._data


  def 			_lowercase   (      self     :			int					,					UpperCAmelCase__     :			List[Any]		)       ->Any:
        """simple docstring"""







        return self._insert(self._header					,					lowercase_					,					self._header._next		)


  def 			_lowercase   (      self     :			Union[str, Any]					,					UpperCAmelCase__     :			str		)       ->Tuple:
        """simple docstring"""







        return self._insert(self._trailer._prev					,					lowercase_					,					self._trailer		)


  def 			_lowercase   (      self     :			Any		)       ->Union[str, Any]:
        """simple docstring"""







        if self.is_empty():
              raise IndexError("""remove_first from empty list"""		)
        return self._delete(self._header._next		)




  def 			_lowercase   (      self     :			Optional[Any]		)       ->Optional[Any]:
        """simple docstring"""







        if self.is_empty():
              raise IndexError("""remove_first from empty list"""		)
        return self._delete(self._trailer._prev		)






"""simple docstring"""





import math
from timeit import timeit







def       __a	(						__lowerCamelCase    ):
   UpperCAmelCase_   :   Tuple     	=       0
   UpperCAmelCase_   :   Any     	=       abs(__lowerCamelCase    )
   while True:
      UpperCAmelCase_   :   Optional[int]     	=       n // 10
      digits += 1
      if n == 0:
         break
   return digits







def       __a	(						__lowerCamelCase    ):
   return 1 if n == 0 else math.floor(math.log(abs(__lowerCamelCase    ),						10    ) + 1    )







def       __a	(						__lowerCamelCase    ):
   return len(str(abs(__lowerCamelCase    )    )    )







def       __a	(						):
   from collections.abc import Callable

   def benchmark_a_function(__lowerCamelCase,						__lowerCamelCase    ) -> None:
      UpperCAmelCase_   :   Optional[Any]     	=       f"""{func.__name__}({value})"""
      UpperCAmelCase_   :   Optional[int]     	=       timeit(f"""__main__.{call}""",						setup="import __main__"    )
      print(f"""{call}: {func(__lowerCamelCase    )} -- {timing} seconds"""    )

   for value in (26_2144, 1125_8999_0684_2624, 126_7650_6002_2822_9401_4967_0320_5376):
      for func in (num_digits, num_digits_fast, num_digits_faster):
         benchmark_a_function(__lowerCamelCase,						__lowerCamelCase    )
      print()


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    benchmark()


