


'''simple docstring'''







class 				__lowerCamelCase				:
    """simple docstring"""


    def __init__(						self    :							Optional[int]   ,							SCREAMING_SNAKE_CASE    :							int):
           _A  :			str											=      data
           _A  :			int
           _A  :			Node






def    lowerCAmelCase__ (       lowerCamelCase  :    Node     ):
       _A  :			List[Any]											=      0
       _A  :			List[str]											=      x






def    lowerCAmelCase__ (       lowerCamelCase  :    Node						,lowerCamelCase  :    Node     ):
       _A  :			Optional[Any]											=      find_set(lowerCamelCase     ), find_set(lowerCamelCase     )
       if x == y:
              return

       elif x.rank > y.rank:
              _A  :			Union[str, Any]											=      x
       else:
              _A  :			Optional[Any]											=      y
              if x.rank == y.rank:
                     y.rank += 1






def    lowerCAmelCase__ (       lowerCamelCase  :    Node     ):
       if x != x.parent:
              _A  :			Union[str, Any]											=      find_set(x.parent     )
       return x.parent






def    lowerCAmelCase__ (       lowerCamelCase  :    Node     ):
       _A  :			Union[str, Any]											=      ({0, 1, 2}, {3, 4, 5})
       for s in sets:
              if node.data in s:
                     return s
       _A  :			str											=      f'{node.data} is not in {sets}'
       raise ValueError(lowerCamelCase     )






def    lowerCAmelCase__ (       ):
       _A  :			str											=      [Node(lowerCamelCase     ) for i in range(6     )]
       for v in vertex:
              make_set(lowerCamelCase     )

       union_set(vertex[0]						,vertex[1]     )
       union_set(vertex[1]						,vertex[2]     )
       union_set(vertex[3]						,vertex[4]     )
       union_set(vertex[3]						,vertex[5]     )

       for nodea in vertex:
              for nodea in vertex:
                     if find_python_set(lowerCamelCase     ).isdisjoint(find_python_set(lowerCamelCase     )     ):
                            assert find_set(lowerCamelCase     ) != find_set(lowerCamelCase     )
                     else:
                            assert find_set(lowerCamelCase     ) == find_set(lowerCamelCase     )


if __name__ == "__main__":
   test_disjoint_set()










'''simple docstring'''







A   :  Optional[Any]       		=				{
    '''0000''': '''0''',
    '''0001''': '''1''',
    '''0010''': '''2''',
    '''0011''': '''3''',
    '''0100''': '''4''',
    '''0101''': '''5''',
    '''0110''': '''6''',
    '''0111''': '''7''',
    '''1000''': '''8''',
    '''1001''': '''9''',
    '''1010''': '''a''',
    '''1011''': '''b''',
    '''1100''': '''c''',
    '''1101''': '''d''',
    '''1110''': '''e''',
    '''1111''': '''f''',
}






def    lowerCAmelCase__ (       lowerCamelCase  :    str     ):
       _A  :			Union[str, Any]											=      str(lowerCamelCase     ).strip()

       # Exceptions
       if not binary_str:
              raise ValueError('Empty string was passed to the function'     )
       _A  :			Any											=      binary_str[0] == '-'
       _A  :			str											=      binary_str[1:] if is_negative else binary_str
       if not all(char in '01' for char in binary_str     ):
              raise ValueError('Non-binary value was passed to the function'     )

       _A  :			Optional[Any]											=      (
           '0' * (4 * (divmod(len(lowerCamelCase     )						,4     )[0] + 1) - len(lowerCamelCase     )) + binary_str
       )

       _A  :			Optional[int]											=      []
       for x in range(0						,len(lowerCamelCase     )						,4     ):
              hexadecimal.append(BITS_TO_HEX[binary_str[x : x + 4]]     )
       _A  :			int											=      '0x' + ''.join(lowerCamelCase     )

       return "-" + hexadecimal_str if is_negative else hexadecimal_str


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

   testmod()






