






from __future__ import annotations

from collections import Counter






def        lowerCamelCase__   (					__lowerCamelCase    :  int	):
  __UpperCAmelCase							:			Tuple     =						[True] * n
  __UpperCAmelCase							:			Any     =						False
  __UpperCAmelCase							:			List[Any]     =						False
  __UpperCAmelCase							:			int     =						True

  for i in range(3						,	int(n**0.5 + 1	)						,	2	):
    __UpperCAmelCase							:			Dict     =						i * 2
    while index < n:
      __UpperCAmelCase							:			int     =						False
      __UpperCAmelCase							:			Optional[Any]     =						index + i

  __UpperCAmelCase							:			List[str]     =						[2]

  for i in range(3						,	__lowerCamelCase						,	2	):
    if is_prime[i]:
      primes.append(__lowerCamelCase	)

  return primes






def        lowerCamelCase__   (					__lowerCamelCase    :  int	):
  __UpperCAmelCase							:			Dict     =						str(__lowerCamelCase	)
  __UpperCAmelCase							:			Tuple     =						[]
  __UpperCAmelCase							:			int     =						["""0""", """1""", """2""", """3""", """4""", """5""", """6""", """7""", """8""", """9"""]

  for duplicate in Counter(__lowerCamelCase	) - Counter(set(__lowerCamelCase	)	):
    __UpperCAmelCase							:			Tuple     =						[int(number_str.replace(__lowerCamelCase						,	__lowerCamelCase	)	) for digit in digits]
    replacements.append(__lowerCamelCase	)

  return replacements






def        lowerCamelCase__   (					__lowerCamelCase    :  int = 8	):
  __UpperCAmelCase							:			Dict     =						set()

  # Filter primes with less than 3 replaceable digits
  __UpperCAmelCase							:			Any     =						{
      x for x in set(prime_sieve(1000000	)	) if len(str(__lowerCamelCase	)	) - len(set(str(__lowerCamelCase	)	)	) >= 3
  }

  for prime in primes:
    if prime in numbers_checked:
      continue

    __UpperCAmelCase							:			Dict     =						digit_replacements(__lowerCamelCase	)

    for family in replacements:
      numbers_checked.update(__lowerCamelCase	)
      __UpperCAmelCase							:			Optional[int]     =						primes.intersection(__lowerCamelCase	)

      if len(__lowerCamelCase	) != family_length:
        continue

      return min(__lowerCamelCase	)

  return -1


if __name__ == "__main__":
       print(solution())










a	: List[str]      =				[[0, 1, 1], [0, 0, 1], [1, 0, 0]]
class 					a					:



      """simple docstring"""


      def __init__(   self      :    Union[str, Any]	,   __lowercase      :    List[str]      )							->   Optional[int]:
        __UpperCAmelCase							:			Dict     =						name
        __UpperCAmelCase							:			Optional[Any]     =						[]
        __UpperCAmelCase							:			List[Any]     =						[]
      def 			UpperCAmelCase   (   self      :    str	,   __lowercase      :    int      )							->   str:
        self.inbound.append(__lowercase      )
      def 			UpperCAmelCase   (   self      :    List[Any]	,   __lowercase      :    Optional[Any]      )							->   List[str]:
        self.outbound.append(__lowercase      )




      def __repr__(   self      :    Any      )							->   int:
        return f"""<node={self.name} inbound={self.inbound} outbound={self.outbound}>"""






def        lowerCamelCase__   (					__lowerCamelCase    :  Dict						,	__lowerCamelCase    :  str=3						,	__lowerCamelCase    :  int=0.8_5	):
  __UpperCAmelCase							:			Optional[int]     =						{}
  for node in nodes:
    __UpperCAmelCase							:			str     =						1

  __UpperCAmelCase							:			Union[str, Any]     =						{}
  for node in nodes:
    __UpperCAmelCase							:			Dict     =						len(node.outbound	)

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






def        lowerCamelCase__   (					):
  __UpperCAmelCase							:			Optional[Any]     =						list(input("""Enter Names of the Nodes: """	).split()	)

  __UpperCAmelCase							:			Dict     =						[Node(__lowerCamelCase	) for name in names]

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

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

  page_rank(__lowerCamelCase	)


if __name__ == "__main__":
       main()


