




class 	_UpperCamelCase					:
      def __init__(	self      :int					)   ->	int:
       UpperCAmelCase__							       =  {}
      def 		UpperCAmelCase_  (	self      :str					)   ->	Optional[Any]:
       print(self.vertex					)
       for i in self.vertex:
        print(__lowerCamelCase       ,					" -> "       ,					" -> ".join([str(__lowerCamelCase					) for j in self.vertex[i]]					)					)
      def 		UpperCAmelCase_  (	self      :List[str]       ,					lowerCamelCase      :Any       ,					lowerCamelCase      :Any					)   ->	Tuple:
       # check if vertex is already present,
       if from_vertex in self.vertex:
        self.vertex[from_vertex].append(__lowerCamelCase					)
       else:
        # else make a new vertex
        UpperCAmelCase__							       =  [to_vertex]
      def 		UpperCAmelCase_  (	self      :Any					)   ->	Optional[Any]:
       # visited array for storing already visited nodes
       UpperCAmelCase__							       =  [False] * len(self.vertex					)

       # call the recursive helper function
       for i in range(len(self.vertex					)					):
        if not visited[i]:
         self.dfs_recursive(__lowerCamelCase       ,					__lowerCamelCase					)







      def 		UpperCAmelCase_  (	self      :List[str]       ,					lowerCamelCase      :Dict       ,					lowerCamelCase      :List[Any]					)   ->	int:
       # mark start vertex as visited
       UpperCAmelCase__							       =  True

       print(__lowerCamelCase       ,					end=" "					)

       # Recur for all the vertices that are adjacent to this node
       for i in self.vertex:
        if not visited[i]:
         self.dfs_recursive(__lowerCamelCase       ,					__lowerCamelCase					)


if __name__ == "__main__":
  _lowerCAmelCase  :      Union[str, Any]						=      Graph()
  g.add_edge(0, 1)
  g.add_edge(0, 2)
  g.add_edge(1, 2)
  g.add_edge(2, 0)
  g.add_edge(2, 3)
  g.add_edge(3, 3)

  g.print_graph()
  print("DFS:")
  g.dfs()

  # OUTPUT:
  # 0  ->  1 -> 2
  # 1  ->  2
  # 2  ->  0 -> 3
  # 3  ->  3
  # DFS:
  #  0 1 2 3












from __future__ import annotations

import math


def 	UpperCamelCase__(       UpperCamelCase__			:       int  )->bool:

       if 1 < number < 4:
              # 2 and 3 are primes
              return True
       elif number < 2 or number % 2 == 0 or number % 3 == 0:
              # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
              return False

       # All primes number are in format of 6k +/- 1
       for i in range(5 ,     int(math.sqrt(UpperCamelCase__  ) + 1  ) ,     6  ):
              if number % i == 0 or number % (i + 2) == 0:
                     return False
       return True


def 	UpperCamelCase__(       UpperCamelCase__			:       int  )->list[int]:
       A__											=						str(UpperCamelCase__  )
       A__											=						[n]
       for i in range(1 ,     len(UpperCamelCase__  )  ):
              list_nums.append(int(str_num[i:]  )  )
              list_nums.append(int(str_num[:-i]  )  )
       return list_nums


def 	UpperCamelCase__(       UpperCamelCase__			:       int  )->bool:
       if len(str(UpperCamelCase__  )  ) > 3:
              if not is_prime(int(str(UpperCamelCase__  )[-3:]  )  ) or not is_prime(int(str(UpperCamelCase__  )[:3]  )  ):
                     return False
       return True


def 	UpperCamelCase__(       UpperCamelCase__			:       int = 11  )->list[int]:
       A__											=						[]
       A__											=						13
       while len(UpperCamelCase__  ) != count:
              if validate(UpperCamelCase__  ):
                     A__											=						list_truncated_nums(UpperCamelCase__  )
                     if all(is_prime(UpperCamelCase__  ) for i in list_nums  ):
                            list_truncated_primes.append(UpperCamelCase__  )
              num += 2
       return list_truncated_primes


def 	UpperCamelCase__(       )->int:
       return sum(compute_truncated_primes(11  )  )


if __name__ == "__main__":
       print(F"{sum(compute_truncated_primes(11)) = }")





