





class 					__A    :

			'''simple docstring'''







			def __init__(    self       ,  __lowerCAmelCase       ,  __lowerCAmelCase=None       ,  __lowerCAmelCase=None							):



				'''simple docstring'''







				lowerCamelCase__								=		data
				lowerCamelCase__								=		previous
				lowerCamelCase__								=		next_node





			def __str__(    self							):



				'''simple docstring'''







				return F'{self.data}'





			def 		__lowerCamelCase				(    self							):



				'''simple docstring'''







				return self.data





			def 		__lowerCamelCase				(    self							):



				'''simple docstring'''







				return self.next





			def 		__lowerCamelCase				(    self							):



				'''simple docstring'''







				return self.previous






class 					__A    :

			'''simple docstring'''







			def __init__(    self       ,  __lowerCAmelCase							):



				'''simple docstring'''







				lowerCamelCase__								=		head





			def __iter__(    self							):



				'''simple docstring'''







				return self





			def 		__lowerCamelCase				(    self							):



				'''simple docstring'''







				if not self.current:
					raise StopIteration
				else:
					lowerCamelCase__								=		self.current.get_data()
					lowerCamelCase__								=		self.current.get_next()
					return value






class 					__A    :

			'''simple docstring'''







			def __init__(    self							):



				'''simple docstring'''







				lowerCamelCase__								=		None  # First node in list
				lowerCamelCase__								=		None  # Last node in list





			def __str__(    self							):



				'''simple docstring'''







				lowerCamelCase__								=		self.head
				lowerCamelCase__								=		[]
				while current is not None:
					nodes.append(current.get_data()							)
					lowerCamelCase__								=		current.get_next()
				return " ".join(str(__lowerCAmelCase							) for node in nodes							)





			def __contains__(    self       ,  __lowerCAmelCase							):



				'''simple docstring'''







				lowerCamelCase__								=		self.head
				while current:
					if current.get_data() == value:
						return True
					lowerCamelCase__								=		current.get_next()
				return False





			def __iter__(    self							):



				'''simple docstring'''







				return LinkedListIterator(self.head							)





			def 		__lowerCamelCase				(    self							):



				'''simple docstring'''







				if self.head:
					return self.head.get_data()
				return None





			def 		__lowerCamelCase				(    self							):



				'''simple docstring'''







				if self.tail:
					return self.tail.get_data()
				return None





			def 		__lowerCamelCase				(    self       ,  __lowerCAmelCase							):



				'''simple docstring'''







				if self.head is None:
					lowerCamelCase__								=		node
					lowerCamelCase__								=		node
				else:
					self.insert_before_node(self.head       ,  __lowerCAmelCase							)





			def 		__lowerCamelCase				(    self       ,  __lowerCAmelCase							):



				'''simple docstring'''







				if self.head is None:
					self.set_head(__lowerCAmelCase							)
				else:
					self.insert_after_node(self.tail       ,  __lowerCAmelCase							)





			def 		__lowerCamelCase				(    self       ,  __lowerCAmelCase							):



				'''simple docstring'''







				lowerCamelCase__								=		Node(__lowerCAmelCase							)
				if self.head is None:
					self.set_head(__lowerCAmelCase							)
				else:
					self.set_tail(__lowerCAmelCase							)





			def 		__lowerCamelCase				(    self       ,  __lowerCAmelCase       ,  __lowerCAmelCase							):



				'''simple docstring'''







				lowerCamelCase__								=		node
				lowerCamelCase__								=		node.previous

				if node.get_previous() is None:
					lowerCamelCase__								=		node_to_insert
				else:
					lowerCamelCase__								=		node_to_insert

				lowerCamelCase__								=		node_to_insert





			def 		__lowerCamelCase				(    self       ,  __lowerCAmelCase       ,  __lowerCAmelCase							):



				'''simple docstring'''







				lowerCamelCase__								=		node
				lowerCamelCase__								=		node.next

				if node.get_next() is None:
					lowerCamelCase__								=		node_to_insert
				else:
					lowerCamelCase__								=		node_to_insert

				lowerCamelCase__								=		node_to_insert





			def 		__lowerCamelCase				(    self       ,  __lowerCAmelCase       ,  __lowerCAmelCase							):



				'''simple docstring'''







				lowerCamelCase__								=		1
				lowerCamelCase__								=		Node(__lowerCAmelCase							)
				lowerCamelCase__								=		self.head
				while node:
					if current_position == position:
						self.insert_before_node(__lowerCAmelCase       ,  __lowerCAmelCase							)
						return
					current_position += 1
					lowerCamelCase__								=		node.next
				self.insert_after_node(self.tail       ,  __lowerCAmelCase							)





			def 		__lowerCamelCase				(    self       ,  __lowerCAmelCase							):



				'''simple docstring'''







				lowerCamelCase__								=		self.head
				while node:
					if node.get_data() == item:
						return node
					lowerCamelCase__								=		node.get_next()
				raise Exception('''Node not found'''							)





			def 		__lowerCamelCase				(    self       ,  __lowerCAmelCase							):



				'''simple docstring'''







				if (node := self.get_node(__lowerCAmelCase							)) is not None:
					if node == self.head:
						lowerCamelCase__								=		self.head.get_next()

					if node == self.tail:
						lowerCamelCase__								=		self.tail.get_previous()

					self.remove_node_pointers(__lowerCAmelCase							)





			@staticmethod
			def 		__lowerCamelCase				(    __lowerCAmelCase							):



				'''simple docstring'''







				if node.get_next():
					lowerCamelCase__								=		node.previous

				if node.get_previous():
					lowerCamelCase__								=		node.next

				lowerCamelCase__								=		None
				lowerCamelCase__								=		None





			def 		__lowerCamelCase				(    self							):



				'''simple docstring'''







				return self.head is None





def lowerCAmelCase__()				->      None:







	'''simple docstring'''









if __name__ == "__main__":
			import doctest

			doctest.testmod()










def lowerCAmelCase__(__snake_case       ,__snake_case							)				->      float:







	'''simple docstring'''







	if mass < 0:
		raise ValueError('''The mass of a body cannot be negative'''							)
	return 0.5 * mass * abs(__snake_case							) * abs(__snake_case							)


if __name__ == "__main__":
			import doctest

			doctest.testmod(verbose=True)



