

"""simple docstring"""





class    _lowerCAmelCase    :







 """simple docstring"""







 def __init__(     self				:     Union[str, Any],   UpperCAmelCase__				:     str      ):
    __lowercase								=		data
    __lowercase								=		4_2
    __lowercase								=		4_2







def     _A    (    UpperCamelCase_	:			Node)      ->		None:
   '''simple docstring'''


   __lowercase								=		0
   __lowercase								=		x




def     _A    (    UpperCamelCase_	:			Node,     UpperCamelCase_	:			Node)      ->		None:
   '''simple docstring'''


   __lowercase						,__lowercase								=		find_set(_A), find_set(_A)
   if x == y:
      return

   elif x.rank > y.rank:
      __lowercase								=		x
   else:
      __lowercase								=		y
      if x.rank == y.rank:
         y.rank += 1




def     _A    (    UpperCamelCase_	:			Node)      ->		Node:
   '''simple docstring'''


   if x != x.parent:
      __lowercase								=		find_set(x.parent)
   return x.parent




def     _A    (    UpperCamelCase_	:			Node)      ->		set:
   '''simple docstring'''


   __lowercase								=		({0, 1, 2}, {3, 4, 5})
   for s in sets:
      if node.data in s:
         return s
   __lowercase								=		F"""{node.data} is not in {sets}"""
   raise ValueError(_A)




def     _A    (    )      ->		None:
   '''simple docstring'''


   __lowercase								=		[Node(_A) for i in range(6)]
   for v in vertex:
      make_set(_A)

   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(_A).isdisjoint(find_python_set(_A)):
            assert find_set(_A) != find_set(_A)
         else:
            assert find_set(_A) == find_set(_A)


if __name__ == "__main__":
   test_disjoint_set()







def        __UpperCamelCase     (      _A					:							str		)				->int:



							"""simple docstring"""
							lowerCamelCase_								=lowerCamelCase_								=0
							for letter in data:
														lowerCamelCase_								=(hash_ << 4) + ord(_A		)
														lowerCamelCase_								=hash_ & 0XF0000000
														if x != 0:
																					hash_ ^= x >> 24
														hash_ &= ~x
							return hash_


if __name__ == "__main__":
	import doctest

	doctest.testmod()
