'''simple docstring'''






def    __UpperCAmelCase			(  a_:       Optional[int]							):
   if not all(char in "01" for char in bin_string							):
      raise ValueError("Non-binary value was passed to the function"							)
   if not bin_string:
      raise ValueError("Empty string was passed to the function"							)
   _UpperCAmelCase							:	List[str]							=   ""
   while len(_lowerCAmelCase							) % 3 != 0:
      _UpperCAmelCase							:	int							=   "0" + bin_string
   _UpperCAmelCase							:	Optional[int]							=   [
       bin_string[index : index + 3]
       for index in range(len(_lowerCAmelCase							)							)
       if index % 3 == 0
   ]
   for bin_group in bin_string_in_3_list:
      _UpperCAmelCase							:	Any							=   0
      for index, val in enumerate(_lowerCAmelCase							):
         oct_val += int(2 ** (2 - index) * int(_lowerCAmelCase							)							)
      oct_string += str(_lowerCAmelCase							)
   return oct_string


if __name__ == "__main__":
     from doctest import testmod

     testmod()






class 					A__   :





      def __init__( self       ,							A_   ):
       '''simple docstring'''




       UpperCamelCase	:					Union[str, Any]       	=   set_counts
       UpperCamelCase	:					int       	=   max(A_   )
       UpperCamelCase	:					Optional[Any]       	=   len(A_   )
       UpperCamelCase	:					Union[str, Any]       	=   [1] * num_sets
       UpperCamelCase	:					Union[str, Any]       	=   list(range(A_   )   )





      def        __UpperCamelCase( self       ,							A_       ,							A_   ):
       '''simple docstring'''




       UpperCamelCase	:					Any       	=   self.get_parent(A_   )
       UpperCamelCase	:					Optional[int]       	=   self.get_parent(A_   )

       if src_parent == dst_parent:
        return False

       if self.ranks[dst_parent] >= self.ranks[src_parent]:
        self.set_counts[dst_parent] += self.set_counts[src_parent]
        UpperCamelCase	:					int       	=   0
        UpperCamelCase	:					Dict       	=   dst_parent
        if self.ranks[dst_parent] == self.ranks[src_parent]:
         self.ranks[dst_parent] += 1
        UpperCamelCase	:					Optional[int]       	=   self.set_counts[dst_parent]
       else:
        self.set_counts[src_parent] += self.set_counts[dst_parent]
        UpperCamelCase	:					Any       	=   0
        UpperCamelCase	:					Optional[int]       	=   src_parent
        UpperCamelCase	:					int       	=   self.set_counts[src_parent]

       UpperCamelCase	:					Any       	=   max(self.max_set       ,							A_   )
       return True





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       if self.parents[disj_set] == disj_set:
        return disj_set
       UpperCamelCase	:					Optional[int]       	=   self.get_parent(self.parents[disj_set]   )
       return self.parents[disj_set]
