



class    a		:
  class    a		:
    UpperCamelCase		:			Dict         =   '_prev', '_data', '_next'



    def __init__(  self	:   Any    ,						lowerCAmelCase	:   Any    ,						lowerCAmelCase	:   str    ,						lowerCAmelCase	:   Optional[int]						)       ->   Dict:


       '''simple docstring'''




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





    def 		lowerCamelCase__    (  self	:   List[str]						)       ->   List[Any]:


       '''simple docstring'''




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







  def __init__(  self	:   str						)       ->   List[str]:


     '''simple docstring'''




     SCREAMING_SNAKE_CASE_:	Any            =self._Node(_A    ,						_A    ,						_A						)
     SCREAMING_SNAKE_CASE_:	Any            =self._Node(_A    ,						_A    ,						_A						)
     SCREAMING_SNAKE_CASE_:	List[Any]            =self._trailer
     SCREAMING_SNAKE_CASE_:	Optional[int]            =self._header
     SCREAMING_SNAKE_CASE_:	Any            =0



  def __len__(  self	:   Any						)       ->   int:


     '''simple docstring'''




     return self._size



  def 		lowerCamelCase__    (  self	:   Dict						)       ->   Tuple:


     '''simple docstring'''




     return self.__len__() == 0



  def 		lowerCamelCase__    (  self	:   List[Any]    ,						lowerCAmelCase	:   List[str]    ,						lowerCAmelCase	:   str    ,						lowerCAmelCase	:   List[str]						)       ->   List[str]:


     '''simple docstring'''




     SCREAMING_SNAKE_CASE_:	Optional[int]            =self._Node(_A    ,						_A    ,						_A						)
     SCREAMING_SNAKE_CASE_:	Union[str, Any]            =new_node
     SCREAMING_SNAKE_CASE_:	Union[str, Any]            =new_node
     self._size += 1
     return self





  def 		lowerCamelCase__    (  self	:   Any    ,						lowerCAmelCase	:   Dict						)       ->   List[Any]:


     '''simple docstring'''




     SCREAMING_SNAKE_CASE_:	str            =node._prev
     SCREAMING_SNAKE_CASE_:	int            =node._next

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







class    a		(					_DoublyLinkedBase    ):



  def 		lowerCamelCase__    (  self	:   List[Any]						)       ->   Tuple:


     '''simple docstring'''




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



  def 		lowerCamelCase__    (  self	:   Optional[Any]						)       ->   List[Any]:


     '''simple docstring'''




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



  def 		lowerCamelCase__    (  self	:   Optional[int]    ,						lowerCAmelCase	:   Union[str, Any]						)       ->   Optional[int]:


     '''simple docstring'''




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



  def 		lowerCamelCase__    (  self	:   Tuple    ,						lowerCAmelCase	:   Optional[Any]						)       ->   Optional[Any]:


     '''simple docstring'''




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



  def 		lowerCamelCase__    (  self	:   Any						)       ->   Optional[Any]:


     '''simple docstring'''




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





  def 		lowerCamelCase__    (  self	:   str						)       ->   Tuple:


     '''simple docstring'''




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








"""simple docstring"""
def        __magic_name__			(							lowercase = 1000	):
   SCREAMING_SNAKE_CASE_:	Dict            =0
   SCREAMING_SNAKE_CASE_:	Any            =0
   while 1:
      num += 3
      if num >= n:
         break
      total += num
      num += 2
      if num >= n:
         break
      total += num
      num += 1
      if num >= n:
         break
      total += num
      num += 3
      if num >= n:
         break
      total += num
      num += 1
      if num >= n:
         break
      total += num
      num += 2
      if num >= n:
         break
      total += num
      num += 3
      if num >= n:
         break
      total += num
   return total


if __name__ == "__main__":
   print(f"""{solution() = }""")



