



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   __lowerCAmelCase  (		UpperCAmelCase_   ):
					"""simple docstring"""






					def __init__(  self       :							Tuple					,       _snake_case       :							str = "▁"					,       _snake_case       :							bool = True					,       _snake_case       :							Union[str, AddedToken] = "<unk>"					,       _snake_case       :							Union[str, AddedToken] = "</s>"					,       _snake_case       :							Union[str, AddedToken] = "<pad>"					,       ):






								"""simple docstring"""


								A__	  =     {
								    'pad': {'id': 0, 'token': pad_token},
								    'eos': {'id': 1, 'token': eos_token},
								    'unk': {'id': 2, 'token': unk_token},
								}

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

								A__	  =     Tokenizer(Unigram()       )

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

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

								A__	  =     {
								    'model': 'SentencePieceUnigram',
								    'replacement': replacement,
								    'add_prefix_space': add_prefix_space,
								}

								super().__init__(_snake_case					,       _snake_case       )



					def      _a				(  self       :							int					,       _snake_case       :							Union[str, List[str]]					,       _snake_case       :							int = 80_00					,       _snake_case       :							bool = True					,       ):






								"""simple docstring"""


								A__	  =     trainers.UnigramTrainer(
								    vocab_size=_snake_case					,       special_tokens=self.special_tokens_list					,       show_progress=_snake_case					,       )

								if isinstance(_snake_case					,       _snake_case       ):
											A__	  =     [files]
								self._tokenizer.train(_snake_case					,       trainer=_snake_case       )

								self.add_unk_id()



					def      _a				(  self       :							Any					,       _snake_case       :							Union[Iterator[str], Iterator[Iterator[str]]]					,       _snake_case       :							int = 80_00					,       _snake_case       :							bool = True					,       ):






								"""simple docstring"""


								A__	  =     trainers.UnigramTrainer(
								    vocab_size=_snake_case					,       special_tokens=self.special_tokens_list					,       show_progress=_snake_case					,       )

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

								self.add_unk_id()



					def      _a				(  self       :							Union[str, Any]       ):






								"""simple docstring"""


								A__	  =     json.loads(self._tokenizer.to_str()       )

								A__	  =     self.special_tokens['unk']['id']

								A__	  =     Tokenizer.from_str(json.dumps(_snake_case       )       )









from __future__ import annotations

from fractions import Fraction


def A    (							__UpperCamelCase			,						__UpperCamelCase       )    ->   bool:
			return (
			    num != den and num % 10 == den // 10 and (num // 10) / (den % 10) == num / den
			)


def A    (							__UpperCamelCase       )    ->   list[str]:
			A__	  =     []
			A__	  =     11
			A__	  =     int('1' + '0' * digit_len       )
			for num in range(__UpperCamelCase			,						__UpperCamelCase       ):
						while den <= 99:
									if (num != den) and (num % 10 == den // 10) and (den % 10 != 0):
												if is_digit_cancelling(__UpperCamelCase			,						__UpperCamelCase       ):
															solutions.append(f'''{num}/{den}'''       )
									den += 1
						num += 1
						A__	  =     10
			return solutions


def A    (							__UpperCamelCase = 2       )    ->   int:
			A__	  =     1.0
			for fraction in fraction_list(__UpperCamelCase       ):
						A__	  =     Fraction(__UpperCamelCase       )
						result *= frac.denominator / frac.numerator
			return int(__UpperCamelCase       )


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




