



"""simple docstring"""






def 			snake_case		(		lowerCAmelCase_  ,						lowerCAmelCase_  ,						lowerCAmelCase_	)						->				int:

  if exponent == 1:
    return base
  if exponent % 2 == 0:
    _snake_case   	=      _modexpt(lowerCAmelCase_  ,						exponent // 2  ,						lowerCAmelCase_	) % modulo_value
    return (x * x) % modulo_value
  else:
    return (base * _modexpt(lowerCAmelCase_  ,						exponent - 1  ,						lowerCAmelCase_	)) % modulo_value




def 			snake_case		(		lowerCAmelCase_ = 1777  ,						lowerCAmelCase_ = 1855  ,						lowerCAmelCase_ = 8	)						->				int:
  _snake_case   	=      base
  for _ in range(1  ,						lowerCAmelCase_	):
    _snake_case   	=      _modexpt(lowerCAmelCase_  ,						lowerCAmelCase_  ,						10**digits	)

  return result


if __name__ == "__main__":
     print(F"{solution() = }")










"""simple docstring"""






from itertools import product




def 			snake_case		(		lowerCAmelCase_  ,						lowerCAmelCase_	)						->				list[int]:
  _snake_case   	=      sides_number
  _snake_case   	=      max_face_number * dice_number
  _snake_case   	=      [0] * (max_total + 1)

  _snake_case   	=      1
  _snake_case   	=      range(lowerCAmelCase_  ,						max_face_number + 1	)
  for dice_numbers in product(lowerCAmelCase_  ,						repeat=lowerCAmelCase_	):
    _snake_case   	=      sum(lowerCAmelCase_	)
    totals_frequencies[total] += 1

  return totals_frequencies




def 			snake_case		(		)						->				float:
  _snake_case   	=      total_frequency_distribution(
      sides_number=4  ,						dice_number=9	)
  _snake_case   	=      total_frequency_distribution(
      sides_number=6  ,						dice_number=6	)

  _snake_case   	=      0
  _snake_case   	=      9
  _snake_case   	=      4 * 9
  _snake_case   	=      6
  for peter_total in range(lowerCAmelCase_  ,						max_peter_total + 1	):
    peter_wins_count += peter_totals_frequencies[peter_total] * sum(
        colin_totals_frequencies[min_colin_total:peter_total]	)

  _snake_case   	=      (4**9) * (6**6)
  _snake_case   	=      peter_wins_count / total_games_number

  _snake_case   	=      round(lowerCAmelCase_  ,						ndigits=7	)

  return rounded_peter_win_probability


if __name__ == "__main__":
     print(F"{solution() = }")





