
class 	A__				:






				def __init__(		self   : Union[str, Any]       ,	a   : int  ):






							'''simple docstring'''







							lowerCAmelCase__ : List[str]   =						data
							lowerCAmelCase__ : int
							lowerCAmelCase__ : Node






def 					lowerCAmelCase__     (    SCREAMING_SNAKE_CASE_	)							->						None:
			lowerCAmelCase__ : Any   =						0
			lowerCAmelCase__ : int   =						x
def 					lowerCAmelCase__     (    SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_	)							->						None:
			lowerCAmelCase__ ,							lowerCAmelCase__ : List[Any]   =						find_set(SCREAMING_SNAKE_CASE_	), find_set(SCREAMING_SNAKE_CASE_	)
			if x == y:
						return

			elif x.rank > y.rank:
						lowerCAmelCase__ : Tuple   =						x
			else:
						lowerCAmelCase__ : List[str]   =						y
						if x.rank == y.rank:
									y.rank += 1
def 					lowerCAmelCase__     (    SCREAMING_SNAKE_CASE_	)							->						Node:
			if x != x.parent:
						lowerCAmelCase__ : Optional[Any]   =						find_set(x.parent	)
			return x.parent
def 					lowerCAmelCase__     (    SCREAMING_SNAKE_CASE_	)							->						set:
			lowerCAmelCase__ : Union[str, Any]   =						({0, 1, 2}, {3, 4, 5})
			for s in sets:
						if node.data in s:
									return s
			lowerCAmelCase__ : str   =						F'''{node.data} is not in {sets}'''
			raise ValueError(SCREAMING_SNAKE_CASE_	)
def 					lowerCAmelCase__     (    )							->						None:
			lowerCAmelCase__ : Any   =						[Node(SCREAMING_SNAKE_CASE_	) for i in range(6	)]
			for v in vertex:
						make_set(SCREAMING_SNAKE_CASE_	)

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


if __name__ == "__main__":
					test_disjoint_set()

lowerCamelCase__        =						[[0, 1, 1], [0, 0, 1], [1, 0, 0]]







class 	A__				:






				def __init__(		self   : Optional[int]       ,	a   : int  ):






							'''simple docstring'''







							lowerCAmelCase__ : List[str]   =						name
							lowerCAmelCase__ : List[Any]   =						[]
							lowerCAmelCase__ : int   =						[]






				def 				_lowerCamelCase						(		self   : List[str]       ,	a   : Union[str, Any]  ):






							'''simple docstring'''







							self.inbound.append(a  )






				def 				_lowerCamelCase						(		self   : Dict       ,	a   : Union[str, Any]  ):






							'''simple docstring'''







							self.outbound.append(a  )






				def __repr__(		self   : Tuple  ):






							'''simple docstring'''







							return f'''<node={self.name} inbound={self.inbound} outbound={self.outbound}>'''






def 					lowerCAmelCase__     (    SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_=3			,				SCREAMING_SNAKE_CASE_=0.85	)							->						Optional[Any]:
			lowerCAmelCase__ : Tuple   =						{}
			for node in nodes:
						lowerCAmelCase__ : Union[str, Any]   =						1

			lowerCAmelCase__ : List[str]   =						{}
			for node in nodes:
						lowerCAmelCase__ : str   =						len(node.outbound	)

			for i in range(SCREAMING_SNAKE_CASE_	):
						print(F'''======= Iteration {i + 1} ======='''	)
						for _, node in enumerate(SCREAMING_SNAKE_CASE_	):
									lowerCAmelCase__ : Optional[int]   =						(1 - d) + d * sum(
									    ranks[ib] / outbounds[ib] for ib in node.inbound	)
						print(SCREAMING_SNAKE_CASE_	)
def 					lowerCAmelCase__     (    )							->						Dict:
			lowerCAmelCase__ : List[Any]   =						list(input('Enter Names of the Nodes: '	).split()	)

			lowerCAmelCase__ : Union[str, Any]   =						[Node(SCREAMING_SNAKE_CASE_	) for name in names]

			for ri, row in enumerate(SCREAMING_SNAKE_CASE_	):
						for ci, col in enumerate(SCREAMING_SNAKE_CASE_	):
									if col == 1:
												nodes[ci].add_inbound(names[ri]	)
												nodes[ri].add_outbound(names[ci]	)

			print('======= Nodes ======='	)
			for node in nodes:
						print(SCREAMING_SNAKE_CASE_	)

			page_rank(SCREAMING_SNAKE_CASE_	)


if __name__ == "__main__":
					main()