
'''simple docstring'''







class 				lowerCAmelCase__     :






					def __init__(     self       ,							__SCREAMING_SNAKE_CASE	):


											"""simple docstring"""





											lowercase_			:  Optional[int]									= data
											lowercase_			:  str									= None
											lowercase_			:  Union[str, Any]									= None






					def __str__(     self	):


											"""simple docstring"""





											return F'''{self.data}'''







class 				lowerCAmelCase__     :






					def __init__(     self	):


											"""simple docstring"""





											lowercase_			:  Any									= None
											lowercase_			:  List[Any]									= None






					def __iter__(     self	):


											"""simple docstring"""





											lowercase_			:  List[Any]									= self.head
											while node:
																	yield node.data
																	lowercase_			:  Dict									= node.next






					def __str__(     self	):


											"""simple docstring"""





											return "->".join([str(__SCREAMING_SNAKE_CASE	) for item in self]	)






					def __len__(     self	):


											"""simple docstring"""





											return sum(1 for _ in self	)






					def 			_snake_case					(     self       ,							__SCREAMING_SNAKE_CASE	):


											"""simple docstring"""





											self.insert_at_nth(0       ,							__SCREAMING_SNAKE_CASE	)






					def 			_snake_case					(     self       ,							__SCREAMING_SNAKE_CASE	):


											"""simple docstring"""





											self.insert_at_nth(len(self	)       ,							__SCREAMING_SNAKE_CASE	)






					def 			_snake_case					(     self       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE	):


											"""simple docstring"""





											lowercase_			:  List[Any]									= len(self	)

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






					def 			_snake_case					(     self	):


											"""simple docstring"""





											return self.delete_at_nth(0	)






					def 			_snake_case					(     self	):


											"""simple docstring"""





											return self.delete_at_nth(len(self	) - 1	)






					def 			_snake_case					(     self       ,							__SCREAMING_SNAKE_CASE	):


											"""simple docstring"""





											lowercase_			:  Union[str, Any]									= len(self	)

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






					def 			_snake_case					(     self       ,							__SCREAMING_SNAKE_CASE	):


											"""simple docstring"""





											lowercase_			:  Union[str, Any]									= self.head

											while current.data != data:  # Find the position to delete
																	if current.next:
																							lowercase_			:  List[str]									= 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
																	lowercase_			:  Dict									= current.next  # 1 --> 3
																	lowercase_			:  str									= current.previous  # 1 <--> 3
											return data






					def 			_snake_case					(     self	):


											"""simple docstring"""





											return len(self	) == 0







def       snake_case_	(       ):



						"""simple docstring"""





						lowercase_			:  Union[str, Any]									= DoublyLinkedList()
						assert linked_list.is_empty() is True
						assert str(__SCREAMING_SNAKE_CASE							) == ""

						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(10							):
												assert len(__SCREAMING_SNAKE_CASE							) == i
												linked_list.insert_at_nth(__SCREAMING_SNAKE_CASE   ,   i + 1							)
						assert str(__SCREAMING_SNAKE_CASE							) == "->".join(str(__SCREAMING_SNAKE_CASE							) for i in range(1   ,   11							)							)

						linked_list.insert_at_head(0							)
						linked_list.insert_at_tail(11							)
						assert str(__SCREAMING_SNAKE_CASE							) == "->".join(str(__SCREAMING_SNAKE_CASE							) for i in range(0   ,   12							)							)

						assert linked_list.delete_head() == 0
						assert linked_list.delete_at_nth(9							) == 10
						assert linked_list.delete_tail() == 11
						assert len(__SCREAMING_SNAKE_CASE							) == 9
						assert str(__SCREAMING_SNAKE_CASE							) == "->".join(str(__SCREAMING_SNAKE_CASE							) for i in range(1   ,   10							)							)


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

							testmod()





'''simple docstring'''







from itertools import combinations, product
def       snake_case_	(       __SCREAMING_SNAKE_CASE      :				int   ,   __SCREAMING_SNAKE_CASE      :				int   ,   __SCREAMING_SNAKE_CASE      :				int   ,   __SCREAMING_SNAKE_CASE      :				int							):



						"""simple docstring"""





						if xa == ya == 0 or xa == ya == 0:
												return False
						lowercase_			:  Optional[Any]									= xa * xa + ya * ya
						lowercase_			:  List[str]									= xa * xa + ya * ya
						lowercase_			:  Any									= (xa - xa) * (xa - xa) + (ya - ya) * (ya - ya)
						return (
						    a_square + b_square == c_square
						    or a_square + c_square == b_square
						    or b_square + c_square == a_square
						)
def       snake_case_	(       __SCREAMING_SNAKE_CASE      :				int = 50							):



						"""simple docstring"""





						return sum(
						    1
						    for pta, pta in combinations(product(range(limit + 1							)   ,   repeat=2							)   ,   2							)
						    if is_right(*__SCREAMING_SNAKE_CASE   ,   *__SCREAMING_SNAKE_CASE							)							)


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



