





"""simple docstring"""




lowerCamelCase_	:		Optional[Any]         =   [[0, 1, 1], [0, 0, 1], [1, 0, 0]]

class 					_UpperCAmelCase    :



      '''simple docstring'''

      def __init__(	self   , snake_case_    ):

        """simple docstring"""

        A_    :			Any									=    name
        A_    :			Union[str, Any]									=    []
        A_    :			Union[str, Any]									=    []

      def    lowerCamelCase_     (	self   , snake_case_    ):

        """simple docstring"""

        self.inbound.append(snake_case_    )

      def    lowerCamelCase_     (	self   , snake_case_    ):

        """simple docstring"""

        self.outbound.append(snake_case_    )

      def __repr__(	self    ):

        """simple docstring"""

        return F"""<node={self.name} inbound={self.inbound} outbound={self.outbound}>"""





def 		UpperCAmelCase__						(	_UpperCAmelCase					,   _UpperCAmelCase=3					,   _UpperCAmelCase=0.85   ):






  """simple docstring"""





  A_    :			Optional[Any]									=    {}
  for node in nodes:
    A_    :			List[Any]									=    1

  A_    :			Any									=    {}
  for node in nodes:
    A_    :			Tuple									=    len(node.outbound   )

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





def 		UpperCAmelCase__						(	):






  """simple docstring"""





  A_    :			Tuple									=    list(input('Enter Names of the Nodes: '   ).split()   )

  A_    :			Dict									=    [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()






def   _SCREAMING_SNAKE_CASE      (	snake_case_		:						int						):
     if not isinstance(snake_case_ ,     snake_case_						):
          __magic_name__				=       f'Input value of [number={number}] must be an integer'
          raise TypeError(snake_case_						)
     if number < 0 or number % 2 == 1:
          return False
     __magic_name__				=       int(number**0.5						)
     return number == number_sqrt * (number_sqrt + 1)


if __name__ == "__main__":
    import doctest

    doctest.testmod()