



'''simple docstring'''





from __future__ import annotations

from typing import Generic, TypeVar

lowercase_	 =						TypeVar("T")






class __A    (						Generic[T]		):



	'''simple docstring'''







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


						"""simple docstring"""



						_a											=						data
						_a											=						self
						_a											=						0






class __A    (						Generic[T]		):



	'''simple docstring'''







	def __init__(self )					->  Tuple:


						"""simple docstring"""



						_a											=						{}



	def       a__						(self				,     A )					->  Union[str, Any]:


						"""simple docstring"""



						_a											=						DisjointSetTreeNode(lowerCamelCase_ )



	def       a__						(self				,     A )					->  Any:


						"""simple docstring"""



						_a											=						self.map[data]
						if elem_ref != elem_ref.parent:
											_a											=						self.find_set(elem_ref.parent.data )
						return elem_ref.parent



	def       a__						(self				,     A				,     A )					->  List[Any]:


						"""simple docstring"""



						if nodea.rank > nodea.rank:
											_a											=						nodea
						else:
											_a											=						nodea
											if nodea.rank == nodea.rank:
																nodea.rank += 1



	def       a__						(self				,     A				,     A )					->  str:


						"""simple docstring"""



						self.link(self.find_set(lowerCamelCase_ )				,     self.find_set(lowerCamelCase_ ) )






class __A    (						Generic[T]		):



	'''simple docstring'''







	def __init__(self )					->  Optional[Any]:


						"""simple docstring"""



						_a											=						{}



	def       a__						(self				,     A )					->  List[Any]:


						"""simple docstring"""



						if node not in self.connections:
											_a											=						{}



	def       a__						(self				,     A				,     A				,     A )					->  Optional[Any]:


						"""simple docstring"""



						self.add_node(lowerCamelCase_ )
						self.add_node(lowerCamelCase_ )
						_a											=						weight
						_a											=						weight



	def       a__						(self )					->  Optional[Any]:


						"""simple docstring"""



						_a											=						[]
						_a											=						set()
						for start in self.connections:
											for end in self.connections[start]:
																if (start, end) not in seen:
																					seen.add((end, start) )
																					edges.append((start, end, self.connections[start][end]) )
						edges.sort(key=lambda A : x[2] )

						# creating the disjoint set
						_a											=						DisjointSetTree[T]()
						for node in self.connections:
											disjoint_set.make_set(lowerCamelCase_ )

						# MST generation
						_a											=						0
						_a											=						0
						_a											=						GraphUndirectedWeighted[T]()
						while num_edges < len(self.connections ) - 1:
											_a											=						edges[index]
											index += 1
											_a											=						disjoint_set.find_set(lowerCamelCase_ )
											_a											=						disjoint_set.find_set(lowerCamelCase_ )
											if parent_u != parent_v:
																num_edges += 1
																graph.add_edge(lowerCamelCase_				,     lowerCamelCase_				,     lowerCamelCase_ )
																disjoint_set.union(lowerCamelCase_				,     lowerCamelCase_ )
						return graph








'''simple docstring'''





from __future__ import annotations

lowercase_	 =						[True] * 1_000_001
lowercase_	 =						2
while i * i <= 1_000_000:
  if seive[i]:
    for j in range(i * i, 1_000_001, i):
      lowercase_	 =						False
  i += 1




def lowerCAmelCase						(__A):



     """simple docstring"""



     return seive[n]




def lowerCAmelCase						(__A):



     """simple docstring"""



     return any(digit in '''02468''' for digit in str(__A))




def lowerCAmelCase						(__A = 1_000_000):



     """simple docstring"""



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




def lowerCAmelCase						():



     """simple docstring"""



     return len(find_circular_primes())


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



