

from transformers import (
    DPRContextEncoderTokenizer,
    DPRContextEncoderTokenizerFast,
    DPRQuestionEncoderTokenizer,
    DPRQuestionEncoderTokenizerFast,
    DPRReaderOutput,
    DPRReaderTokenizer,
    DPRReaderTokenizerFast,
)
from transformers.testing_utils import require_tokenizers, slow
from transformers.tokenization_utils_base import BatchEncoding

from ..bert.test_tokenization_bert import BertTokenizationTest

@require_tokenizers
class __UpperCamelCase    (							_a		):






					'''simple docstring'''



					__magic_name__     			=      DPRContextEncoderTokenizer
					__magic_name__     			=      DPRContextEncoderTokenizerFast
					__magic_name__     			=      True

@require_tokenizers
class __UpperCamelCase    (							_a		):






					'''simple docstring'''



					__magic_name__     			=      DPRQuestionEncoderTokenizer
					__magic_name__     			=      DPRQuestionEncoderTokenizerFast
					__magic_name__     			=      True

@require_tokenizers
class __UpperCamelCase    (							_a		):






					'''simple docstring'''



					__magic_name__     			=      DPRReaderTokenizer
					__magic_name__     			=      DPRReaderTokenizerFast
					__magic_name__     			=      True





					@slow
					def       _UpperCAmelCase						(							self	):
						UpperCAmelCase__:  Any		       =   self.tokenizer_class.from_pretrained("bert-base-uncased"	)

						UpperCAmelCase__:  Dict		       =   tokenizer.encode("question sequence"							,			add_special_tokens=lowerCamelCase__	)
						UpperCAmelCase__:  str		       =   tokenizer.encode("title sequence"							,			add_special_tokens=lowerCamelCase__	)
						UpperCAmelCase__:  str		       =   tokenizer.encode("text sequence " * 4							,			add_special_tokens=lowerCamelCase__	)
						UpperCAmelCase__:  List[str]		       =   [[1_0_1] + text_a + [1_0_2] + text_a + [1_0_2] + text_a]
						UpperCAmelCase__:  str		       =   BatchEncoding({"input_ids": input_ids}	)

						UpperCAmelCase__:  Union[str, Any]		       =   [[0] * len(input_ids[0]	)]
						UpperCAmelCase__:  Tuple		       =   [[0] * len(input_ids[0]	)]
						UpperCAmelCase__:  Optional[int]		       =   [0]
						UpperCAmelCase__:  Any		       =   DPRReaderOutput(lowerCamelCase__							,			lowerCamelCase__							,			lowerCamelCase__	)

						UpperCAmelCase__       ,	UpperCAmelCase__:  Optional[Any]		       =   8, 9
						UpperCAmelCase__:  str		       =   1_0
						UpperCAmelCase__:  Dict		       =   1_0
						UpperCAmelCase__:  List[Any]		       =   tokenizer.decode_best_spans(lowerCamelCase__							,			lowerCamelCase__	)
						self.assertEqual(predicted_spans[0].start_index							,			lowerCamelCase__	)
						self.assertEqual(predicted_spans[0].end_index							,			lowerCamelCase__	)
						self.assertEqual(predicted_spans[0].doc_id							,			0	)





					@slow
					def       _UpperCAmelCase						(							self	):
						UpperCAmelCase__:  Optional[Any]		       =   self.tokenizer_class.from_pretrained("bert-base-uncased"	)

						UpperCAmelCase__:  Union[str, Any]		       =   tokenizer.encode("question sequence"							,			add_special_tokens=lowerCamelCase__	)
						UpperCAmelCase__:  List[Any]		       =   tokenizer.encode("title sequence"							,			add_special_tokens=lowerCamelCase__	)
						UpperCAmelCase__:  List[Any]		       =   tokenizer.encode("text sequence"							,			add_special_tokens=lowerCamelCase__	)
						UpperCAmelCase__:  Dict		       =   [1_0_1] + text_a + [1_0_2] + text_a + [1_0_2] + text_a
						UpperCAmelCase__:  str		       =   tokenizer(questions=["question sequence"]							,			titles=["title sequence"]							,			texts=["text sequence"]	)
						self.assertIn("input_ids"							,			lowerCamelCase__	)
						self.assertIn("attention_mask"							,			lowerCamelCase__	)
						self.assertListEqual(encoded_input["input_ids"][0]							,			lowerCamelCase__	)


from __future__ import annotations

from collections import Counter



def  _A  (			SCREAMING_SNAKE_CASE			):
	UpperCAmelCase__:  Optional[Any]		       =   [True] * n
	UpperCAmelCase__:  Any		       =   False
	UpperCAmelCase__:  Tuple		       =   False
	UpperCAmelCase__:  Optional[Any]		       =   True

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

	UpperCAmelCase__:  int		       =   [2]

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

	return primes



def  _A  (			SCREAMING_SNAKE_CASE			):
	UpperCAmelCase__:  List[Any]		       =   str(SCREAMING_SNAKE_CASE			)
	UpperCAmelCase__:  Tuple		       =   []
	UpperCAmelCase__:  Optional[int]		       =   ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]

	for duplicate in Counter(SCREAMING_SNAKE_CASE			) - Counter(set(SCREAMING_SNAKE_CASE			)			):
		UpperCAmelCase__:  Optional[Any]		       =   [int(number_str.replace(SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE			)			) for digit in digits]
		replacements.append(SCREAMING_SNAKE_CASE			)

	return replacements



def  _A  (			SCREAMING_SNAKE_CASE = 8			):
	UpperCAmelCase__:  Union[str, Any]		       =   set()

	# Filter primes with less than 3 replaceable digits
	UpperCAmelCase__:  Optional[Any]		       =   {
	    x for x in set(prime_sieve(1_0_0_0_0_0_0			)			) if len(str(SCREAMING_SNAKE_CASE			)			) - len(set(str(SCREAMING_SNAKE_CASE			)			)			) >= 3
	}

	for prime in primes:
		if prime in numbers_checked:
			continue

		UpperCAmelCase__:  Optional[int]		       =   digit_replacements(SCREAMING_SNAKE_CASE			)

		for family in replacements:
			numbers_checked.update(SCREAMING_SNAKE_CASE			)
			UpperCAmelCase__:  Dict		       =   primes.intersection(SCREAMING_SNAKE_CASE			)

			if len(SCREAMING_SNAKE_CASE			) != family_length:
				continue

			return min(SCREAMING_SNAKE_CASE			)

	return -1


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