



'''simple docstring'''
from __future__ import annotations

from collections import Counter



def 		_SCREAMING_SNAKE_CASE							(				lowerCamelCase__   :      int				):


			'''simple docstring'''







			A:      str														=   [True] * n
			A:      str														=   False
			A:      Any														=   False
			A:      List[str]														=   True

			for i in range(3							,							int(n**0.5 + 1				)							,							2				):
						A:      str														=   i * 2
						while index < n:
									A:      List[str]														=   False
									A:      int														=   index + i

			A:      Tuple														=   [2]

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

			return primes



def 		_SCREAMING_SNAKE_CASE							(				lowerCamelCase__   :      int				):


			'''simple docstring'''







			A:      List[Any]														=   str(lowerCamelCase__				)
			A:      Union[str, Any]														=   []
			A:      Any														=   ["""0""", """1""", """2""", """3""", """4""", """5""", """6""", """7""", """8""", """9"""]

			for duplicate in Counter(lowerCamelCase__				) - Counter(set(lowerCamelCase__				)				):
						A:      Dict														=   [int(number_str.replace(lowerCamelCase__							,							lowerCamelCase__				)				) for digit in digits]
						replacements.append(lowerCamelCase__				)

			return replacements



def 		_SCREAMING_SNAKE_CASE							(				lowerCamelCase__   :      int = 8				):


			'''simple docstring'''







			A:      Optional[Any]														=   set()

			# Filter primes with less than 3 replaceable digits
			A:      Union[str, 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

						A:      Any														=   digit_replacements(lowerCamelCase__				)

						for family in replacements:
									numbers_checked.update(lowerCamelCase__				)
									A:      Union[str, Any]														=   primes.intersection(lowerCamelCase__				)

									if len(lowerCamelCase__				) != family_length:
												continue

									return min(lowerCamelCase__				)

			return -1


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










'''simple docstring'''
from __future__ import annotations



def 		_SCREAMING_SNAKE_CASE							(				lowerCamelCase__   :      list[int]				):


			'''simple docstring'''







			A:      int														=   [0] * len(lowerCamelCase__				)
			for i in range(1							,							len(lowerCamelCase__				)				):
						A:      Dict														=   duration_times[i - 1] + waiting_times[i - 1]
			return waiting_times



def 		_SCREAMING_SNAKE_CASE							(				lowerCamelCase__   :      list[int]							,							lowerCamelCase__   :      list[int]				):


			'''simple docstring'''







			return [
			    duration_time + waiting_times[i]
			    for i, duration_time in enumerate(lowerCamelCase__				)
			]



def 		_SCREAMING_SNAKE_CASE							(				lowerCamelCase__   :      list[int]				):


			'''simple docstring'''







			return sum(lowerCamelCase__				) / len(lowerCamelCase__				)



def 		_SCREAMING_SNAKE_CASE							(				lowerCamelCase__   :      list[int]				):


			'''simple docstring'''







			return sum(lowerCamelCase__				) / len(lowerCamelCase__				)


if __name__ == "__main__":
					# process id's
					__SCREAMING_SNAKE_CASE :      Optional[Any]             =[1, 2, 3]

					# ensure that we actually have processes
					if len(processes) == 0:
										print('Zero amount of processes')
										raise SystemExit(0)

					# duration time of all processes
					__SCREAMING_SNAKE_CASE :      Dict             =[19, 8, 9]

					# ensure we can match each id to a duration time
					if len(duration_times) != len(processes):
										print('Unable to match all id\'s with their duration time')
										raise SystemExit(0)

					# get the waiting times and the turnaround times
					__SCREAMING_SNAKE_CASE :      Tuple             =calculate_waiting_times(duration_times)
					__SCREAMING_SNAKE_CASE :      List[Any]             =calculate_turnaround_times(duration_times, waiting_times)

					# get the average times
					__SCREAMING_SNAKE_CASE :      List[Any]             =calculate_average_waiting_time(waiting_times)
					__SCREAMING_SNAKE_CASE :      Union[str, Any]             =calculate_average_turnaround_time(turnaround_times)

					# print all the results
					print('Process ID\tDuration Time\tWaiting Time\tTurnaround Time')
					for i, process in enumerate(processes):
										print(
										    f"""{process}\t\t{duration_times[i]}\t\t{waiting_times[i]}\t\t"""
										    f"""{turnaround_times[i]}"""
										)
					print(f"""Average waiting time = {average_waiting_time}""")
					print(f"""Average turn around time = {average_turnaround_time}""")





