






'''simple docstring'''







import json
from typing import Iterator, List, Union

from tokenizers import AddedToken, Regex, Tokenizer, decoders, normalizers, pre_tokenizers, trainers
from tokenizers.implementations.base_tokenizer import BaseTokenizer
from tokenizers.models import Unigram
from tokenizers.processors import TemplateProcessing




class 		UpperCamelCase__    (a			):




		'''simple docstring'''





		def __init__(      self   ,_lowerCAmelCase = "▁"   ,_lowerCAmelCase = True   ,_lowerCAmelCase = "<unk>"   ,_lowerCAmelCase = "</s>"   ,_lowerCAmelCase = "<pad>"   ,):
								lowerCamelCase__         =  {
								    """pad""": {"""id""": 0, """token""": pad_token},
								    """eos""": {"""id""": 1, """token""": eos_token},
								    """unk""": {"""id""": 2, """token""": unk_token},
								}

								lowerCamelCase__         =  [None] * len(self.special_tokens       )
								for token_dict in self.special_tokens.values():
														lowerCamelCase__         =  token_dict["""token"""]

								lowerCamelCase__         =  Tokenizer(Unigram()       )

								lowerCamelCase__         =  normalizers.Sequence(
								    [
								        normalizers.Nmt(),
								        normalizers.NFKC(),
								        normalizers.Replace(Regex(""" {2,}"""       )   ,""" """       ),
								        normalizers.Lowercase(),
								    ]       )
								lowerCamelCase__         =  pre_tokenizers.Sequence(
								    [
								        pre_tokenizers.Metaspace(replacement=_lowerCAmelCase   ,add_prefix_space=_lowerCAmelCase       ),
								        pre_tokenizers.Digits(individual_digits=_lowerCAmelCase       ),
								        pre_tokenizers.Punctuation(),
								    ]       )
								lowerCamelCase__         =  decoders.Metaspace(replacement=_lowerCAmelCase   ,add_prefix_space=_lowerCAmelCase       )

								lowerCamelCase__         =  TemplateProcessing(
								    single=F'''$A {self.special_tokens["eos"]["token"]}'''   ,special_tokens=[(self.special_tokens["""eos"""]["""token"""], self.special_tokens["""eos"""]["""id"""])]   ,)

								lowerCamelCase__         =  {
								    """model""": """SentencePieceUnigram""",
								    """replacement""": replacement,
								    """add_prefix_space""": add_prefix_space,
								}

								super().__init__(_lowerCAmelCase   ,_lowerCAmelCase       )






		def 			UpperCamelCase_					(      self   ,_lowerCAmelCase   ,_lowerCAmelCase = 80_00   ,_lowerCAmelCase = True   ,):
								lowerCamelCase__         =  trainers.UnigramTrainer(
								    vocab_size=_lowerCAmelCase   ,special_tokens=self.special_tokens_list   ,show_progress=_lowerCAmelCase   ,)

								if isinstance(_lowerCAmelCase   ,_lowerCAmelCase       ):
														lowerCamelCase__         =  [files]
								self._tokenizer.train(_lowerCAmelCase   ,trainer=_lowerCAmelCase       )

								self.add_unk_id()






		def 			UpperCamelCase_					(      self   ,_lowerCAmelCase   ,_lowerCAmelCase = 80_00   ,_lowerCAmelCase = True   ,):
								lowerCamelCase__         =  trainers.UnigramTrainer(
								    vocab_size=_lowerCAmelCase   ,special_tokens=self.special_tokens_list   ,show_progress=_lowerCAmelCase   ,)

								self._tokenizer.train_from_iterator(_lowerCAmelCase   ,trainer=_lowerCAmelCase       )

								self.add_unk_id()






		def 			UpperCamelCase_					(      self       ):
								lowerCamelCase__         =  json.loads(self._tokenizer.to_str()       )

								lowerCamelCase__         =  self.special_tokens["""unk"""]["""id"""]

								lowerCamelCase__         =  Tokenizer.from_str(json.dumps(_lowerCAmelCase       )       )









'''simple docstring'''







def 						A__			(				):
						return [
						    a * b * (1000 - a - b)
						    for a in range(1   ,    999						)
						    for b in range(__lowerCAmelCase   ,    999						)
						    if (a * a + b * b == (1000 - a - b) ** 2)
						][0]


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

