





'''simple docstring'''


import numpy as np

_lowerCamelCase				:	Optional[Any]				    =       [
    ['a', 'b', 'c', 'd', 'e'],
    ['f', 'g', 'h', 'i', 'k'],
    ['l', 'm', 'n', 'o', 'p'],
    ['q', 'r', 's', 't', 'u'],
    ['v', 'w', 'x', 'y', 'z'],
]



class 							__UpperCAmelCase  :







		'''simple docstring'''







		def __init__(self						:      Tuple      ):
			A							  =      np.array(_lowerCAmelCase      )







		def        A     (self						:      Union[str, Any]      ,      _lowerCAmelCase						:      str      ):
			A  ,    A							  =      np.where(letter == self.SQUARE      )
			A							  =      np.concatenate([indexa + 1, indexa + 1]      )
			return indexes







		def        A     (self						:      List[Any]      ,      _lowerCAmelCase						:      int      ,      _lowerCAmelCase						:      int      ):
			return self.SQUARE[indexa - 1, indexa - 1]







		def        A     (self						:      Dict      ,      _lowerCAmelCase						:      str      ):
			A							  =      message.lower()
			A							  =      message.replace("""j"""      ,      """i"""      )

			A							  =      """"""
			for letter_index in range(len(_lowerCAmelCase      )      ):
				if message[letter_index] != " ":
					A							  =      self.letter_to_numbers(message[letter_index]      )
					A							  =      encoded_message + str(numbers[0]      ) + str(numbers[1]      )
				elif message[letter_index] == " ":
					A							  =      encoded_message + """ """

			return encoded_message







		def        A     (self						:      List[Any]      ,      _lowerCAmelCase						:      str      ):
			A							  =      message.replace(""" """      ,      """  """      )
			A							  =      """"""
			for numbers_index in range(int(len(_lowerCAmelCase      ) / 2      )      ):
				if message[numbers_index * 2] != " ":
					A							  =      message[numbers_index * 2]
					A							  =      message[numbers_index * 2 + 1]

					A							  =      self.numbers_to_letter(int(_lowerCAmelCase      )      ,      int(_lowerCAmelCase      )      )
					A							  =      decoded_message + letter
				elif message[numbers_index * 2] == " ":
					A							  =      decoded_message + """ """

			return decoded_message













'''simple docstring'''


_lowerCamelCase				:	List[str]				    =       [[0, 1, 1], [0, 0, 1], [1, 0, 0]]



class 							__UpperCAmelCase  :







		'''simple docstring'''







		def __init__(self						:      List[Any]      ,      _lowerCAmelCase						:      List[Any]      ):
			A							  =      name
			A							  =      []
			A							  =      []







		def        A     (self						:      Dict      ,      _lowerCAmelCase						:      str      ):
			self.inbound.append(_lowerCAmelCase      )







		def        A     (self						:      Dict      ,      _lowerCAmelCase						:      Any      ):
			self.outbound.append(_lowerCAmelCase      )







		def __repr__(self						:      Tuple      ):
			return F"""<node={self.name} inbound={self.inbound} outbound={self.outbound}>"""






def    __a (     UpperCAmelCase       ,			UpperCAmelCase=3       ,			UpperCAmelCase=0.85    )      ->Tuple:



	"""simple docstring"""







	A							  =      {}
	for node in nodes:
		A							  =      1

	A							  =      {}
	for node in nodes:
		A							  =      len(node.outbound    )

	for i in range(UpperCAmelCase    ):
		print(f"""======= Iteration {i + 1} ======="""    )
		for _, node in enumerate(UpperCAmelCase    ):
			A							  =      (1 - d) + d * sum(
			    ranks[ib] / outbounds[ib] for ib in node.inbound    )
		print(UpperCAmelCase    )




def    __a (     )      ->Any:



	"""simple docstring"""







	A							  =      list(input("""Enter Names of the Nodes: """    ).split()    )

	A							  =      [Node(UpperCAmelCase    ) for name in names]

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

	print("""======= Nodes ======="""    )
	for node in nodes:
		print(UpperCAmelCase    )

	page_rank(UpperCAmelCase    )


if __name__ == "__main__":
				main()

