



class 							lowerCAmelCase_		:





		class 							lowerCAmelCase_		:
				SCREAMING_SNAKE_CASE_       :			List[Any]					       =	"""_prev""", """_data""", """_next"""







				def __init__(    self  :   List[str]       ,		UpperCAmelCase_  :   Tuple       ,		UpperCAmelCase_  :   str       ,		UpperCAmelCase_  :   List[str]					)       ->		List[Any]:


								'''simple docstring'''







								_UpperCAmelCase						:  Any     					=	link_p
								_UpperCAmelCase						:  List[str]     					=	element
								_UpperCAmelCase						:  Tuple     					=	link_n







				def 					a_  (    self  :   Optional[int]					)       ->		List[str]:


								'''simple docstring'''







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







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


						'''simple docstring'''







						_UpperCAmelCase						:  Tuple     					=	self._Node(UpperCAmelCase_       ,		UpperCAmelCase_       ,		UpperCAmelCase_					)
						_UpperCAmelCase						:  Optional[Any]     					=	self._Node(UpperCAmelCase_       ,		UpperCAmelCase_       ,		UpperCAmelCase_					)
						_UpperCAmelCase						:  Optional[Any]     					=	self._trailer
						_UpperCAmelCase						:  Any     					=	self._header
						_UpperCAmelCase						:  List[Any]     					=	0







		def __len__(    self  :   Optional[Any]					)       ->		Union[str, Any]:


						'''simple docstring'''







						return self._size







		def 					a_  (    self  :   Optional[Any]					)       ->		str:


						'''simple docstring'''







						return self.__len__() == 0







		def 					a_  (    self  :   Optional[int]       ,		UpperCAmelCase_  :   str       ,		UpperCAmelCase_  :   Union[str, Any]       ,		UpperCAmelCase_  :   List[Any]					)       ->		Optional[Any]:


						'''simple docstring'''







						_UpperCAmelCase						:  int     					=	self._Node(UpperCAmelCase_       ,		UpperCAmelCase_       ,		UpperCAmelCase_					)
						_UpperCAmelCase						:  Any     					=	new_node
						_UpperCAmelCase						:  Union[str, Any]     					=	new_node
						self._size += 1
						return self







		def 					a_  (    self  :   Dict       ,		UpperCAmelCase_  :   Optional[int]					)       ->		Dict:


						'''simple docstring'''







						_UpperCAmelCase						:  Dict     					=	node._prev
						_UpperCAmelCase						:  int     					=	node._next

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





class 							lowerCAmelCase_		(		_DoublyLinkedBase     ):







		def 					a_  (    self  :   Optional[int]					)       ->		int:


						'''simple docstring'''







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







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


						'''simple docstring'''







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







		def 					a_  (    self  :   Dict       ,		UpperCAmelCase_  :   str					)       ->		Any:


						'''simple docstring'''







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







		def 					a_  (    self  :   Tuple       ,		UpperCAmelCase_  :   Dict					)       ->		List[Any]:


						'''simple docstring'''







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







		def 					a_  (    self  :   Tuple					)       ->		List[str]:


						'''simple docstring'''







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







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


						'''simple docstring'''







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





UpperCAmelCase__			:   Optional[int]      			=    [0.4_85, 0.4_56, 0.4_06]
UpperCAmelCase__			:   Union[str, Any]      			=    [0.2_29, 0.2_24, 0.2_25]
UpperCAmelCase__			:   Union[str, Any]      			=    [0.5, 0.5, 0.5]
UpperCAmelCase__			:   Optional[Any]      			=    [0.5, 0.5, 0.5]
UpperCAmelCase__			:   str      			=    [0.48_14_54_66, 0.4_57_82_75, 0.40_82_10_73]
UpperCAmelCase__			:   Dict      			=    [0.26_86_29_54, 0.26_13_02_58, 0.27_57_77_11]
