




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   __a(					_a       ):






    """simple docstring"""





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

         UpperCAmelCase_      :							List[Any]       =      [None] * len(self.special_tokens  )
         for token_dict in self.special_tokens.values():
              UpperCAmelCase_      :							Tuple       =      token_dict['''token''']

         UpperCAmelCase_      :							str       =      Tokenizer(Unigram()  )

         UpperCAmelCase_      :							Union[str, Any]       =      normalizers.Sequence(
             [
                 normalizers.Nmt(),
                 normalizers.NFKC(),
                 normalizers.Replace(Regex(''' {2,}'''  )       ,''' '''  ),
                 normalizers.Lowercase(),
             ]  )
         UpperCAmelCase_      :							Optional[Any]       =      pre_tokenizers.Sequence(
             [
                 pre_tokenizers.Metaspace(replacement=_SCREAMING_SNAKE_CASE       ,add_prefix_space=_SCREAMING_SNAKE_CASE  ),
                 pre_tokenizers.Digits(individual_digits=_SCREAMING_SNAKE_CASE  ),
                 pre_tokenizers.Punctuation(),
             ]  )
         UpperCAmelCase_      :							Optional[Any]       =      decoders.Metaspace(replacement=_SCREAMING_SNAKE_CASE       ,add_prefix_space=_SCREAMING_SNAKE_CASE  )

         UpperCAmelCase_      :							Dict       =      TemplateProcessing(
             single=f'''$A {self.special_tokens["eos"]["token"]}'''       ,special_tokens=[(self.special_tokens['''eos''']['''token'''], self.special_tokens['''eos''']['''id'''])]       ,)

         UpperCAmelCase_      :							Optional[Any]       =      {
             '''model''': '''SentencePieceUnigram''',
             '''replacement''': replacement,
             '''add_prefix_space''': add_prefix_space,
         }

         super().__init__(_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE  )





    def 							a__				(				self       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE = 8_000       ,_SCREAMING_SNAKE_CASE = True       ,)			->		Optional[Any]:
         UpperCAmelCase_      :							int       =      trainers.UnigramTrainer(
             vocab_size=_SCREAMING_SNAKE_CASE       ,special_tokens=self.special_tokens_list       ,show_progress=_SCREAMING_SNAKE_CASE       ,)

         if isinstance(_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE  ):
              UpperCAmelCase_      :							Union[str, Any]       =      [files]
         self._tokenizer.train(_SCREAMING_SNAKE_CASE       ,trainer=_SCREAMING_SNAKE_CASE  )

         self.add_unk_id()





    def 							a__				(				self       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE = 8_000       ,_SCREAMING_SNAKE_CASE = True       ,)			->		Union[str, Any]:
         UpperCAmelCase_      :							Union[str, Any]       =      trainers.UnigramTrainer(
             vocab_size=_SCREAMING_SNAKE_CASE       ,special_tokens=self.special_tokens_list       ,show_progress=_SCREAMING_SNAKE_CASE       ,)

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

         self.add_unk_id()





    def 							a__				(				self  )			->		Union[str, Any]:
         UpperCAmelCase_      :							Optional[Any]       =      json.loads(self._tokenizer.to_str()  )

         UpperCAmelCase_      :							Tuple       =      self.special_tokens['''unk''']['''id''']

         UpperCAmelCase_      :							Optional[Any]       =      Tokenizer.from_str(json.dumps(_SCREAMING_SNAKE_CASE  )  )





from __future__ import annotations

from fractions import Fraction







def lowerCamelCase__       (      _lowercase			,						_lowercase				):

     '''simple docstring'''


     return (
         num != den and num % 10 == den // 10 and (num // 10) / (den % 10) == num / den
     )







def lowerCamelCase__       (      _lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							Optional[int]       =      []
     UpperCAmelCase_      :							Tuple       =      11
     UpperCAmelCase_      :							int       =      int('''1''' + '''0''' * digit_len				)
     for num in range(_lowercase			,						_lowercase				):
          while den <= 99:
               if (num != den) and (num % 10 == den // 10) and (den % 10 != 0):
                    if is_digit_cancelling(_lowercase			,						_lowercase				):
                         solutions.append(f'''{num}/{den}'''				)
               den += 1
          num += 1
          UpperCAmelCase_      :							Any       =      10
     return solutions







def lowerCamelCase__       (      _lowercase = 2				):

     '''simple docstring'''


     UpperCAmelCase_      :							Tuple       =      1.0
     for fraction in fraction_list(_lowercase				):
          UpperCAmelCase_      :							Optional[Any]       =      Fraction(_lowercase				)
          result *= frac.denominator / frac.numerator
     return int(_lowercase				)


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