from __future__ import annotations

from collections import Counter
def 							lowerCAmelCase(	__lowerCamelCase						):
					__a							=   [True] * n
					__a							=   False
					__a							=   False
					__a							=   True

					for i in range(3      ,				int(n**0.5 + 1						)      ,				2						):
										__a							=   i * 2
										while index < n:
															__a							=   False
															__a							=   index + i

					__a							=   [2]

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

					return primes
def 							lowerCAmelCase(	__lowerCamelCase						):
					__a							=   str(__lowerCamelCase						)
					__a							=   []
					__a							=   ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']

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

					return replacements
def 							lowerCAmelCase(	__lowerCamelCase = 8						):
					__a							=   set()

					# Filter primes with less than 3 replaceable digits
					__a							=   {
					    x for x in set(prime_sieve(100_0000						)						) if len(str(__lowerCamelCase						)						) - len(set(str(__lowerCamelCase						)						)						) >= 3
					}

					for prime in primes:
										if prime in numbers_checked:
															continue

										__a							=   digit_replacements(__lowerCamelCase						)

										for family in replacements:
															numbers_checked.update(__lowerCamelCase						)
															__a							=   primes.intersection(__lowerCamelCase						)

															if len(__lowerCamelCase						) != family_length:
																				continue

															return min(__lowerCamelCase						)

					return -1


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





# as due to their complexity multi-gpu tests could impact other tests, and to aid debug we have those in a separate module.

import os
import sys

from transformers.testing_utils import TestCasePlus, execute_subprocess_async, get_gpu_count, require_torch_gpu, slow

from .utils import load_json


class 						a__							(   __snake_case		):



			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls    ) ->    Optional[int]:
								return cls







			@slow
			@require_torch_gpu
			def __SCREAMING_SNAKE_CASE							(						self    ) ->    Dict:
								__a							=   self.get_auto_remove_tmp_dir()
								__a							=   f'''
            --model_name Helsinki-NLP/opus-mt-en-ro
            --save_dir {output_dir}
            --data_dir {self.test_file_dir_str}/test_data/wmt_en_ro
            --num_beams 2
            --task translation
        '''.split()

								# we want this test to run even if there is only one GPU, but if there are more we use them all
								__a							=   get_gpu_count()
								__a							=   f'''
            -m torch.distributed.launch
            --nproc_per_node={n_gpu}
            {self.test_file_dir}/run_distributed_eval.py
        '''.split()
								__a							=   [sys.executable] + distributed_args + args
								execute_subprocess_async(UpperCAmelCase      ,						env=self.get_env()    )

								__a							=   os.path.join(UpperCAmelCase      ,						'test_bleu.json'    )
								__a							=   load_json(UpperCAmelCase    )
								# print(metrics)
								self.assertGreaterEqual(metrics['bleu']      ,						2_5    )




