
class       a		:







							def __init__(						self  :  List[str]      ,				snake_case__  :  int      ,				snake_case__  :  Dict=None      ,				snake_case__  :  List[Any]=None ):
								"""simple docstring"""







								__lowerCAmelCase         =							data
								__lowerCAmelCase         =							previous
								__lowerCAmelCase         =							next_node







							def __str__(						self  :  str ):
								"""simple docstring"""







								return F"{self.data}"







							def       UpperCAmelCase__					(						self  :  Dict ):
								"""simple docstring"""







								return self.data







							def       UpperCAmelCase__					(						self  :  Optional[Any] ):
								"""simple docstring"""







								return self.next







							def       UpperCAmelCase__					(						self  :  Union[str, Any] ):
								"""simple docstring"""







								return self.previous

class       a		:







							def __init__(						self  :  List[str]      ,				snake_case__  :  str ):
								"""simple docstring"""







								__lowerCAmelCase         =							head







							def __iter__(						self  :  Dict ):
								"""simple docstring"""







								return self







							def       UpperCAmelCase__					(						self  :  Union[str, Any] ):
								"""simple docstring"""







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

class       a		:







							def __init__(						self  :  Any ):
								"""simple docstring"""







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







							def __str__(						self  :  str ):
								"""simple docstring"""







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







							def __contains__(						self  :  Union[str, Any]      ,				snake_case__  :  int ):
								"""simple docstring"""







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







							def __iter__(						self  :  Union[str, Any] ):
								"""simple docstring"""







								return LinkedListIterator(self.head )







							def       UpperCAmelCase__					(						self  :  Optional[Any] ):
								"""simple docstring"""







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







							def       UpperCAmelCase__					(						self  :  Union[str, Any] ):
								"""simple docstring"""







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







							def       UpperCAmelCase__					(						self  :  str      ,				snake_case__  :  Node ):
								"""simple docstring"""







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







							def       UpperCAmelCase__					(						self  :  List[str]      ,				snake_case__  :  Node ):
								"""simple docstring"""







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







							def       UpperCAmelCase__					(						self  :  Union[str, Any]      ,				snake_case__  :  int ):
								"""simple docstring"""







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







							def       UpperCAmelCase__					(						self  :  Optional[Any]      ,				snake_case__  :  Node      ,				snake_case__  :  Node ):
								"""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       UpperCAmelCase__					(						self  :  List[str]      ,				snake_case__  :  Node      ,				snake_case__  :  Node ):
								"""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       UpperCAmelCase__					(						self  :  int      ,				snake_case__  :  int      ,				snake_case__  :  int ):
								"""simple docstring"""







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







							def       UpperCAmelCase__					(						self  :  Optional[int]      ,				snake_case__  :  int ):
								"""simple docstring"""







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







							def       UpperCAmelCase__					(						self  :  str      ,				snake_case__  :  List[str] ):
								"""simple docstring"""







								if (node := self.get_node(snake_case__ )) 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(snake_case__ )







							@staticmethod
							def       UpperCAmelCase__					(						snake_case__  :  Node ):
								"""simple docstring"""







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

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

								__lowerCAmelCase         =							None
								__lowerCAmelCase         =							None







							def       UpperCAmelCase__					(						self  :  int ):
								"""simple docstring"""







								return self.head is None






def 		_UpperCAmelCase   (	):






	"""simple docstring"""




if __name__ == "__main__":
					import doctest

					doctest.testmod()








from __future__ import annotations

UpperCamelCase_   	=	[True] * 1_0_0_0_0_0_1
UpperCamelCase_   	=	2
while i * i <= 1_0_0_0_0_0_0:
					if seive[i]:
										for j in range(i * i, 1_0_0_0_0_0_1, i):
															UpperCamelCase_   	=	False
					i += 1






def 		_UpperCAmelCase   (	UpperCamelCase:     int  ):






	"""simple docstring"""


	return seive[n]






def 		_UpperCAmelCase   (	UpperCamelCase:     int  ):






	"""simple docstring"""


	return any(digit in "02468" for digit in str(UpperCamelCase  )  )






def 		_UpperCAmelCase   (	UpperCamelCase:     int = 1_0_0_0_0_0_0  ):






	"""simple docstring"""


	__lowerCAmelCase         =							[2]  # result already includes the number 2.
	for num in range(3			,							limit + 1			,							2  ):
		if is_prime(UpperCamelCase  ) and not contains_an_even_digit(UpperCamelCase  ):
			__lowerCAmelCase         =							str(UpperCamelCase  )
			__lowerCAmelCase         =							[int(str_num[j:] + str_num[:j]  ) for j in range(len(UpperCamelCase  )  )]
			if all(is_prime(UpperCamelCase  ) for i in list_nums  ):
				result.append(UpperCamelCase  )
	return result






def 		_UpperCAmelCase   (	):






	"""simple docstring"""


	return len(find_circular_primes()  )


if __name__ == "__main__":
					print(f'''{len(find_circular_primes()) = }''')






