
class    _UpperCamelCase:

						def __init__(					self		:			Any	,						_lowerCamelCase		:			Any			):
													_UpperCAmelCase  :			List[str]	       =		data
													_UpperCAmelCase  :			Any	       =		None
													_UpperCAmelCase  :			Any	       =		None






						def __str__(					self		:			int			):
													return f"""{self.data}"""







class    _UpperCamelCase:

						def __init__(					self		:			List[str]			):
													_UpperCAmelCase  :			str	       =		None
													_UpperCAmelCase  :			Dict	       =		None

						def __iter__(					self		:			List[str]			):
													_UpperCAmelCase  :			Optional[Any]	       =		self.head
													while node:
																				yield node.data
																				_UpperCAmelCase  :			Optional[int]	       =		node.next

						def __str__(					self		:			Optional[Any]			):
													return "->".join([str(_lowerCamelCase			) for item in self]			)

						def __len__(					self		:			str			):
													return sum(1 for _ in self			)

						def 						a__ (					self		:			str	,						_lowerCamelCase		:			Optional[int]			):
													self.insert_at_nth(0	,						_lowerCamelCase			)

						def 						a__ (					self		:			Dict	,						_lowerCamelCase		:			Optional[Any]			):
													self.insert_at_nth(len(self			)	,						_lowerCamelCase			)

						def 						a__ (					self		:			List[Any]	,						_lowerCamelCase		:			int	,						_lowerCamelCase		:			str			):
													_UpperCAmelCase  :			Any	       =		len(self			)

													if not 0 <= index <= length:
																				raise IndexError("list index out of range"			)
													_UpperCAmelCase  :			str	       =		Node(_lowerCamelCase			)
													if self.head is None:
																				_UpperCAmelCase  :			str	       =		new_node
													elif index == 0:
																				_UpperCAmelCase  :			Any	       =		new_node
																				_UpperCAmelCase  :			Any	       =		self.head
																				_UpperCAmelCase  :			Any	       =		new_node
													elif index == length:
																				_UpperCAmelCase  :			Union[str, Any]	       =		new_node
																				_UpperCAmelCase  :			Optional[Any]	       =		self.tail
																				_UpperCAmelCase  :			Optional[Any]	       =		new_node
													else:
																				_UpperCAmelCase  :			Dict	       =		self.head
																				for _ in range(0	,						_lowerCamelCase			):
																											_UpperCAmelCase  :			Optional[int]	       =		temp.next
																				_UpperCAmelCase  :			List[Any]	       =		new_node
																				_UpperCAmelCase  :			str	       =		temp.previous
																				_UpperCAmelCase  :			Union[str, Any]	       =		temp
																				_UpperCAmelCase  :			List[Any]	       =		new_node

						def 						a__ (					self		:			Dict			):
													return self.delete_at_nth(0			)

						def 						a__ (					self		:			Dict			):
													return self.delete_at_nth(len(self			) - 1			)

						def 						a__ (					self		:			int	,						_lowerCamelCase		:			int			):
													_UpperCAmelCase  :			List[Any]	       =		len(self			)

													if not 0 <= index <= length - 1:
																				raise IndexError("list index out of range"			)
													_UpperCAmelCase  :			Optional[Any]	       =		self.head  # default first node
													if length == 1:
																				_UpperCAmelCase  :			List[str]	       =		None
													elif index == 0:
																				_UpperCAmelCase  :			Union[str, Any]	       =		self.head.next
																				_UpperCAmelCase  :			List[Any]	       =		None
													elif index == length - 1:
																				_UpperCAmelCase  :			str	       =		self.tail
																				_UpperCAmelCase  :			str	       =		self.tail.previous
																				_UpperCAmelCase  :			Union[str, Any]	       =		None
													else:
																				_UpperCAmelCase  :			Optional[int]	       =		self.head
																				for _ in range(0	,						_lowerCamelCase			):
																											_UpperCAmelCase  :			List[str]	       =		temp.next
																				_UpperCAmelCase  :			List[Any]	       =		temp
																				_UpperCAmelCase  :			Any	       =		temp.previous
																				_UpperCAmelCase  :			List[str]	       =		temp.next
													return delete_node.data

						def 						a__ (					self		:			Dict	,						_lowerCamelCase		:			str			):
													_UpperCAmelCase  :			Union[str, Any]	       =		self.head

													while current.data != data:  # Find the position to delete
																				if current.next:
																											_UpperCAmelCase  :			Any	       =		current.next
																				else:  # We have reached the end an no value matches
																											raise ValueError("No data matching given value"			)

													if current == self.head:
																				self.delete_head()

													elif current == self.tail:
																				self.delete_tail()

													else:  # Before: 1 <--> 2(current) <--> 3
																				_UpperCAmelCase  :			List[str]	       =		current.next  # 1 --> 3
																				_UpperCAmelCase  :			List[str]	       =		current.previous  # 1 <--> 3
													return data






						def 						a__ (					self		:			int			):
													return len(self			) == 0







def 		lowerCAmelCase_     (     )   ->      None:

							"""simple docstring"""






							_UpperCAmelCase  :			Any	       =		DoublyLinkedList()
							assert linked_list.is_empty() is True
							assert str(UpperCAmelCase__  ) == ""

							try:
														linked_list.delete_head()
														raise AssertionError  # This should not happen.
							except IndexError:
														assert True  # This should happen.

							try:
														linked_list.delete_tail()
														raise AssertionError  # This should not happen.
							except IndexError:
														assert True  # This should happen.

							for i in range(1_0  ):
														assert len(UpperCAmelCase__  ) == i
														linked_list.insert_at_nth(UpperCAmelCase__      ,	i + 1  )
							assert str(UpperCAmelCase__  ) == "->".join(str(UpperCAmelCase__  ) for i in range(1      ,	1_1  )  )

							linked_list.insert_at_head(0  )
							linked_list.insert_at_tail(1_1  )
							assert str(UpperCAmelCase__  ) == "->".join(str(UpperCAmelCase__  ) for i in range(0      ,	1_2  )  )

							assert linked_list.delete_head() == 0
							assert linked_list.delete_at_nth(9  ) == 1_0
							assert linked_list.delete_tail() == 1_1
							assert len(UpperCAmelCase__  ) == 9
							assert str(UpperCAmelCase__  ) == "->".join(str(UpperCAmelCase__  ) for i in range(1      ,	1_0  )  )


if __name__ == "__main__":
				from doctest import testmod

				testmod()












"""simple docstring"""



def   _lowerCAmelCase		(				UpperCAmelCase__							:       int = 4_0_0_0_0_0_0   )		->int:
						A__    :	int			=	1
						A__    :	List[str]			=	2
						A__    :	Union[str, Any]			=	0
						while j <= n:
												if j % 2 == 0:
																		total += j
												A__	,	A__    :	str			=	j, i + j

						return total


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






