

"""simple docstring"""





class    _lowerCAmelCase    :







 """simple docstring"""







 class    _lowerCAmelCase    :







  """simple docstring"""







  __UpperCAmelCase      :   Tuple  						=      """_prev""", """_data""", """_next"""


  def __init__(     self				:     List[str],   UpperCAmelCase__				:     int,   UpperCAmelCase__				:     Optional[Any],   UpperCAmelCase__				:     int      ):
     __lowercase								=		link_p
     __lowercase								=		element
     __lowercase								=		link_n



  def    _lowercase					(     self				:     Tuple      ):
     return (
         F""" Prev -> {self._prev is not None}, Next -> {self._next is not None}"""
     )







 def __init__(     self				:     Optional[Any]      ):
    __lowercase								=		self._Node(UpperCAmelCase__,   UpperCAmelCase__,   UpperCAmelCase__      )
    __lowercase								=		self._Node(UpperCAmelCase__,   UpperCAmelCase__,   UpperCAmelCase__      )
    __lowercase								=		self._trailer
    __lowercase								=		self._header
    __lowercase								=		0


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


 def    _lowercase					(     self				:     str      ):
    return self.__len__() == 0


 def    _lowercase					(     self				:     int,   UpperCAmelCase__				:     Optional[Any],   UpperCAmelCase__				:     Tuple,   UpperCAmelCase__				:     Tuple      ):
    __lowercase								=		self._Node(UpperCAmelCase__,   UpperCAmelCase__,   UpperCAmelCase__      )
    __lowercase								=		new_node
    __lowercase								=		new_node
    self._size += 1
    return self



 def    _lowercase					(     self				:     Tuple,   UpperCAmelCase__				:     List[str]      ):
    __lowercase								=		node._prev
    __lowercase								=		node._next

    __lowercase								=		successor
    __lowercase								=		predecessor
    self._size -= 1
    __lowercase								=		node._data
    __lowercase								=		__lowercase								=		__lowercase								=		None
    del node
    return temp







class    _lowerCAmelCase    (      _DoublyLinkedBase  ):







 """simple docstring"""







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


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


 def    _lowercase					(     self				:     Tuple,   UpperCAmelCase__				:     Optional[Any]      ):
    return self._insert(self._header,   UpperCAmelCase__,   self._header._next      )


 def    _lowercase					(     self				:     Dict,   UpperCAmelCase__				:     Optional[Any]      ):
    return self._insert(self._trailer._prev,   UpperCAmelCase__,   self._trailer      )


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



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










def 							__lowerCAmelCase			(UpperCAmelCase_		):
    return n * (2 * n - 1)
def 							__lowerCAmelCase			(UpperCAmelCase_		):
    a__  			=							(1 + 24 * n) ** 0.5
    return ((1 + root) / 6) % 1 == 0
def 							__lowerCAmelCase			(UpperCAmelCase_ = 144		):
    a__  			=							start
    a__  			=							hexagonal_num(UpperCAmelCase_		)
    while not is_pentagonal(UpperCAmelCase_		):
        n += 1
        a__  			=							hexagonal_num(UpperCAmelCase_		)
    return num


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






