




'''simple docstring'''



class       lowerCAmelCase				:


       def __init__(				self      ,					__SCREAMING_SNAKE_CASE					) ->					None:



            '''simple docstring'''




            __snake_case         =					data
            __snake_case         =					42
            __snake_case         =					42







def      _UpperCamelCase	(_lowerCamelCase							:       Node		)->				None:




     '''simple docstring'''





     __snake_case         =					0
     __snake_case         =					x







def      _UpperCamelCase	(_lowerCamelCase							:       Node				,		_lowerCamelCase							:       Node		)->				None:




     '''simple docstring'''





     __snake_case   ,      __snake_case         =					find_set(_lowerCamelCase		), find_set(_lowerCamelCase		)
     if x == y:
          return

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







def      _UpperCamelCase	(_lowerCamelCase							:       Node		)->				Node:




     '''simple docstring'''





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







def      _UpperCamelCase	(_lowerCamelCase							:       Node		)->				set:




     '''simple docstring'''





     __snake_case         =					({0, 1, 2}, {3, 4, 5})
     for s in sets:
          if node.data in s:
               return s
     __snake_case         =					f'''{node.data} is not in {sets}'''
     raise ValueError(_lowerCamelCase		)







def      _UpperCamelCase	()->				None:




     '''simple docstring'''





     __snake_case         =					[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'''



def      _UpperCamelCase	(_lowerCamelCase							:       list				,		_lowerCamelCase							:       int		)->				int:




     '''simple docstring'''





     for index, item in enumerate(_lowerCamelCase		):
          if item == target:
               return index
     return -1







def      _UpperCamelCase	(_lowerCamelCase							:       list				,		_lowerCamelCase							:       int				,		_lowerCamelCase							:       int				,		_lowerCamelCase							:       int		)->				int:




     '''simple docstring'''





     if not (0 <= high < len(_lowerCamelCase		) and 0 <= low < len(_lowerCamelCase		)):
          raise Exception('''Invalid upper or lower bound!'''		)
     if high < low:
          return -1
     if sequence[low] == target:
          return low
     if sequence[high] == target:
          return high
     return rec_linear_search(_lowerCamelCase				,		low + 1				,		high - 1				,		_lowerCamelCase		)


if __name__ == "__main__":
     UpperCAmelCase_    :					List[Any]					      =						input('''Enter numbers separated by comma:\n''').strip()
     UpperCAmelCase_    :					Optional[int]					      =						[int(item.strip()) for item in user_input.split(''',''')]

     UpperCAmelCase_    :					List[str]					      =						int(input('''Enter a single number to be found in the list:\n''').strip())
     UpperCAmelCase_    :					Optional[int]					      =						linear_search(sequence, target)
     if result != -1:
          print(F"""linear_search({sequence}, {target}) = {result}""")
     else:
          print(F"""{target} was not found in {sequence}""")






