


class 							A   :
					'''simple docstring'''






					def __init__(self   :						int				, _UpperCAmelCase   :						int				, _UpperCAmelCase   :						Optional[int]=None				, _UpperCAmelCase   :						str=None		)						->       int:




							"""simple docstring"""


							lowercase__					      =		data
							lowercase__					      =		previous
							lowercase__					      =		next_node

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




							"""simple docstring"""


							return f'''{self.data}'''

					def   lowerCamelCase__					(self   :						Dict		)						->       int:




							"""simple docstring"""


							return self.data

					def   lowerCamelCase__					(self   :						Optional[Any]		)						->       Dict:




							"""simple docstring"""


							return self.next


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




							"""simple docstring"""


							return self.previous






class 							A   :
					'''simple docstring'''






					def __init__(self   :						Optional[int]				, _UpperCAmelCase   :						str		)						->       int:




							"""simple docstring"""


							lowercase__					      =		head

					def __iter__(self   :						Dict		)						->       Tuple:




							"""simple docstring"""


							return self


					def   lowerCamelCase__					(self   :						List[Any]		)						->       Union[str, Any]:




							"""simple docstring"""


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






class 							A   :
					'''simple docstring'''






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




							"""simple docstring"""


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

					def __str__(self   :						Optional[Any]		)						->       Optional[int]:




							"""simple docstring"""


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

					def __contains__(self   :						Optional[int]				, _UpperCAmelCase   :						int		)						->       str:




							"""simple docstring"""


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

					def __iter__(self   :						Any		)						->       Optional[int]:




							"""simple docstring"""


							return LinkedListIterator(self.head		)

					def   lowerCamelCase__					(self   :						Optional[int]		)						->       Dict:




							"""simple docstring"""


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

					def   lowerCamelCase__					(self   :						Tuple		)						->       Union[str, Any]:




							"""simple docstring"""


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

					def   lowerCamelCase__					(self   :						Optional[Any]				, _UpperCAmelCase   :						Node		)						->       None:




							"""simple docstring"""


							if self.head is None:
									lowercase__					      =		node
									lowercase__					      =		node
							else:
									self.insert_before_node(self.head				, _UpperCAmelCase		)

					def   lowerCamelCase__					(self   :						Optional[Any]				, _UpperCAmelCase   :						Node		)						->       None:




							"""simple docstring"""


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

					def   lowerCamelCase__					(self   :						int				, _UpperCAmelCase   :						int		)						->       None:




							"""simple docstring"""


							lowercase__					      =		Node(_UpperCAmelCase		)
							if self.head is None:
									self.set_head(_UpperCAmelCase		)
							else:
									self.set_tail(_UpperCAmelCase		)

					def   lowerCamelCase__					(self   :						str				, _UpperCAmelCase   :						Node				, _UpperCAmelCase   :						Node		)						->       None:




							"""simple docstring"""


							lowercase__					      =		node
							lowercase__					      =		node.previous

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

							lowercase__					      =		node_to_insert

					def   lowerCamelCase__					(self   :						Any				, _UpperCAmelCase   :						Node				, _UpperCAmelCase   :						Node		)						->       None:




							"""simple docstring"""


							lowercase__					      =		node
							lowercase__					      =		node.next

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

							lowercase__					      =		node_to_insert

					def   lowerCamelCase__					(self   :						Tuple				, _UpperCAmelCase   :						int				, _UpperCAmelCase   :						int		)						->       None:




							"""simple docstring"""


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

					def   lowerCamelCase__					(self   :						List[str]				, _UpperCAmelCase   :						int		)						->       Node:




							"""simple docstring"""


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

					def   lowerCamelCase__					(self   :						List[str]				, _UpperCAmelCase   :						Dict		)						->       str:




							"""simple docstring"""


							if (node := self.get_node(_UpperCAmelCase		)) is not None:
									if node == self.head:
											lowercase__					      =		self.head.get_next()

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

									self.remove_node_pointers(_UpperCAmelCase		)

					@staticmethod
					def   lowerCamelCase__					(_UpperCAmelCase   :						Node		)						->       None:




							"""simple docstring"""


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

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

							lowercase__					      =		None
							lowercase__					      =		None


					def   lowerCamelCase__					(self   :						Union[str, Any]		)						->       List[Any]:




							"""simple docstring"""


							return self.head is None






def 			UpperCamelCase (     )       ->  None:
		"""simple docstring"""






if __name__ == "__main__":
	import doctest

	doctest.testmod()





def 			UpperCamelCase (     __magic_name__					:							str   ,   __magic_name__					:							str					)       ->  list:
		"""simple docstring"""




		lowercase__					      =		len(__magic_name__					)
		lowercase__					      =		[]
		for i in range(len(__magic_name__					) - pat_len + 1					):
				lowercase__					      =		True
				for j in range(__magic_name__					):
						if s[i + j] != pattern[j]:
								lowercase__					      =		False
								break
				if match_found:
						position.append(__magic_name__					)
		return position


if __name__ == "__main__":
	assert naive_pattern_search('ABCDEFG', 'DE') == [3]
	print(naive_pattern_search('ABAAABCDBBABCDDEBCABC', 'ABC'))

