





'''simple docstring'''

class __a			:





   def __init__(       self					:      Optional[Any]     ):

      '''simple docstring'''

      __SCREAMING_SNAKE_CASE   				=							0
      __SCREAMING_SNAKE_CASE   				=							0
      __SCREAMING_SNAKE_CASE   				=							{}





   def   UpperCAmelCase__  (       self					:      List[str]					,lowerCamelCase					:      List[str]     ):

      '''simple docstring'''

      if vertex not in self.adjacency:
         __SCREAMING_SNAKE_CASE   				=							{}
         self.num_vertices += 1





   def   UpperCAmelCase__  (       self					:      Optional[Any]					,lowerCamelCase					:      str					,lowerCamelCase					:      Tuple					,lowerCamelCase					:      Optional[Any]     ):

      '''simple docstring'''

      self.add_vertex(UpperCamelCase_     )
      self.add_vertex(UpperCamelCase_     )

      if head == tail:
         return

      __SCREAMING_SNAKE_CASE   				=							weight
      __SCREAMING_SNAKE_CASE   				=							weight





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

      '''simple docstring'''

      __SCREAMING_SNAKE_CASE   				=							self.get_edges()
      for edge in edges:
         __SCREAMING_SNAKE_CASE				,  __SCREAMING_SNAKE_CASE				,  __SCREAMING_SNAKE_CASE   				=							edge
         edges.remove((tail, head, weight)     )
      for i in range(len(UpperCamelCase_     )     ):
         __SCREAMING_SNAKE_CASE   				=							list(edges[i]     )

      edges.sort(key=lambda lowerCamelCase     : e[2]     )
      for i in range(len(UpperCamelCase_     ) - 1     ):
         if edges[i][2] >= edges[i + 1][2]:
            __SCREAMING_SNAKE_CASE   				=							edges[i][2] + 1
      for edge in edges:
         __SCREAMING_SNAKE_CASE				,  __SCREAMING_SNAKE_CASE				,  __SCREAMING_SNAKE_CASE   				=							edge
         __SCREAMING_SNAKE_CASE   				=							weight
         __SCREAMING_SNAKE_CASE   				=							weight





   def __str__(       self					:      Any     ):

      '''simple docstring'''

      __SCREAMING_SNAKE_CASE   				=							""""""
      for tail in self.adjacency:
         for head in self.adjacency[tail]:
            __SCREAMING_SNAKE_CASE   				=							self.adjacency[head][tail]
            string += f"""{head} -> {tail} == {weight}\n"""
      return string.rstrip("""\n"""     )





   def   UpperCAmelCase__  (       self					:      str     ):

      '''simple docstring'''

      __SCREAMING_SNAKE_CASE   				=							[]
      for tail in self.adjacency:
         for head in self.adjacency[tail]:
            output.append((tail, head, self.adjacency[head][tail])     )
      return output





   def   UpperCAmelCase__  (       self					:      Dict     ):

      '''simple docstring'''

      return self.adjacency.keys()





   @staticmethod
   def   UpperCAmelCase__  (       lowerCamelCase					:      Tuple=None					,lowerCamelCase					:      Union[str, Any]=None     ):

      '''simple docstring'''

      __SCREAMING_SNAKE_CASE   				=							Graph()
      if vertices is None:
         __SCREAMING_SNAKE_CASE   				=							[]
      if edges is None:
         __SCREAMING_SNAKE_CASE   				=							[]
      for vertex in vertices:
         g.add_vertex(UpperCamelCase_     )
      for edge in edges:
         g.add_edge(*UpperCamelCase_     )
      return g







   class __a			:





      def __init__(       self					:      Dict     ):

         '''simple docstring'''

         __SCREAMING_SNAKE_CASE   				=							{}
         __SCREAMING_SNAKE_CASE   				=							{}





      def __len__(       self					:      List[Any]     ):

         '''simple docstring'''

         return len(self.parent     )





      def   UpperCAmelCase__  (       self					:      Dict					,lowerCamelCase					:      List[Any]     ):

         '''simple docstring'''

         if item in self.parent:
            return self.find(UpperCamelCase_     )

         __SCREAMING_SNAKE_CASE   				=							item
         __SCREAMING_SNAKE_CASE   				=							0
         return item





      def   UpperCAmelCase__  (       self					:      Optional[Any]					,lowerCamelCase					:      Any     ):

         '''simple docstring'''

         if item not in self.parent:
            return self.make_set(UpperCamelCase_     )
         if item != self.parent[item]:
            __SCREAMING_SNAKE_CASE   				=							self.find(self.parent[item]     )
         return self.parent[item]





      def   UpperCAmelCase__  (       self					:      Dict					,lowerCamelCase					:      str					,lowerCamelCase					:      Dict     ):

         '''simple docstring'''

         __SCREAMING_SNAKE_CASE   				=							self.find(UpperCamelCase_     )
         __SCREAMING_SNAKE_CASE   				=							self.find(UpperCamelCase_     )

         if roota == roota:
            return roota

         if self.rank[roota] > self.rank[roota]:
            __SCREAMING_SNAKE_CASE   				=							roota
            return roota

         if self.rank[roota] < self.rank[roota]:
            __SCREAMING_SNAKE_CASE   				=							roota
            return roota

         if self.rank[roota] == self.rank[roota]:
            self.rank[roota] += 1
            __SCREAMING_SNAKE_CASE   				=							roota
            return roota
         return None





   @staticmethod
   def   UpperCAmelCase__  (       lowerCamelCase					:      List[Any]     ):

      '''simple docstring'''

      __SCREAMING_SNAKE_CASE   				=							graph.num_vertices

      __SCREAMING_SNAKE_CASE   				=							Graph.UnionFind()
      __SCREAMING_SNAKE_CASE   				=							[]
      while num_components > 1:
         __SCREAMING_SNAKE_CASE   				=							{}
         for vertex in graph.get_vertices():
            __SCREAMING_SNAKE_CASE   				=							-1

         __SCREAMING_SNAKE_CASE   				=							graph.get_edges()
         for edge in edges:
            __SCREAMING_SNAKE_CASE				,  __SCREAMING_SNAKE_CASE				,  __SCREAMING_SNAKE_CASE   				=							edge
            edges.remove((tail, head, weight)     )
         for edge in edges:
            __SCREAMING_SNAKE_CASE				,  __SCREAMING_SNAKE_CASE				,  __SCREAMING_SNAKE_CASE   				=							edge
            __SCREAMING_SNAKE_CASE   				=							union_find.find(UpperCamelCase_     )
            __SCREAMING_SNAKE_CASE   				=							union_find.find(UpperCamelCase_     )
            if seta != seta:
               if cheap_edge[seta] == -1 or cheap_edge[seta][2] > weight:
                  __SCREAMING_SNAKE_CASE   				=							[head, tail, weight]

               if cheap_edge[seta] == -1 or cheap_edge[seta][2] > weight:
                  __SCREAMING_SNAKE_CASE   				=							[head, tail, weight]
         for vertex in cheap_edge:
            if cheap_edge[vertex] != -1:
               __SCREAMING_SNAKE_CASE				,  __SCREAMING_SNAKE_CASE				,  __SCREAMING_SNAKE_CASE   				=							cheap_edge[vertex]
               if union_find.find(UpperCamelCase_     ) != union_find.find(UpperCamelCase_     ):
                  union_find.union(UpperCamelCase_					,UpperCamelCase_     )
                  mst_edges.append(cheap_edge[vertex]     )
                  __SCREAMING_SNAKE_CASE   				=							num_components - 1
      __SCREAMING_SNAKE_CASE   				=							Graph.build(edges=UpperCamelCase_     )
      return mst













"""simple docstring"""
def 							A						(				__snake_case: str  )    ->		list:

       """simple docstring"""





       return [
           txt[:a] + txt[a].upper() + txt[a + 1 :]
           for a in range(len(__snake_case  )  )
           if txt[a].isalpha()
       ]


if __name__ == "__main__":
 __import__("""doctest""").testmod()