"""simple docstring"""






from typing import Dict, List, Optional, Tuple

from ...tokenization_utils import AddedToken, PreTrainedTokenizer
from ...utils import logging


lowerCAmelCase__    :    List[Any]			=      logging.get_logger(__name__)
class 							snake_case			(					_A							):




					"""simple docstring"""

					snake_case__							       =					["input_ids", "attention_mask"]







					def __init__(							self  :      Dict       ,lowerCamelCase__  :      Dict="[PAD]"       ,lowerCamelCase__  :      Dict="[BOS]"       ,lowerCamelCase__  :      Optional[Any]="[EOS]"       ,lowerCamelCase__  :      Optional[int]="[MASK]"       ,lowerCamelCase__  :      List[str]="[CLS]"       ,lowerCamelCase__  :      Optional[Any]="[SEP]"       ,lowerCamelCase__  :      int=2_048       ,**lowerCamelCase__  :      Dict       ,):
									UpperCAmelCase__			 =				AddedToken(__SCREAMING_SNAKE_CASE       ,lstrip=__SCREAMING_SNAKE_CASE       ,rstrip=__SCREAMING_SNAKE_CASE     ) if isinstance(__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE     ) else pad_token
									UpperCAmelCase__			 =				AddedToken(__SCREAMING_SNAKE_CASE       ,lstrip=__SCREAMING_SNAKE_CASE       ,rstrip=__SCREAMING_SNAKE_CASE     ) if isinstance(__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE     ) else bos_token
									UpperCAmelCase__			 =				AddedToken(__SCREAMING_SNAKE_CASE       ,lstrip=__SCREAMING_SNAKE_CASE       ,rstrip=__SCREAMING_SNAKE_CASE     ) if isinstance(__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE     ) else eos_token
									UpperCAmelCase__			 =				AddedToken(__SCREAMING_SNAKE_CASE       ,lstrip=__SCREAMING_SNAKE_CASE       ,rstrip=__SCREAMING_SNAKE_CASE     ) if isinstance(__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE     ) else mask_token
									UpperCAmelCase__			 =				AddedToken(__SCREAMING_SNAKE_CASE       ,lstrip=__SCREAMING_SNAKE_CASE       ,rstrip=__SCREAMING_SNAKE_CASE     ) if isinstance(__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE     ) else cls_token
									UpperCAmelCase__			 =				AddedToken(__SCREAMING_SNAKE_CASE       ,lstrip=__SCREAMING_SNAKE_CASE       ,rstrip=__SCREAMING_SNAKE_CASE     ) if isinstance(__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE     ) else sep_token

									super().__init__(
									    pad_token=__SCREAMING_SNAKE_CASE       ,bos_token=__SCREAMING_SNAKE_CASE       ,eos_token=__SCREAMING_SNAKE_CASE       ,mask_token=__SCREAMING_SNAKE_CASE       ,cls_token=__SCREAMING_SNAKE_CASE       ,sep_token=__SCREAMING_SNAKE_CASE       ,model_max_length=__SCREAMING_SNAKE_CASE       ,**__SCREAMING_SNAKE_CASE       ,)

									UpperCAmelCase__			 =				2**8  # utf is 8 bits

									# define special tokens dict
									UpperCAmelCase__			 =				{
									    self.pad_token: 0,
									    self.bos_token: 1,
									    self.eos_token: 2,
									    self.mask_token: 3,
									    self.cls_token: 4,
									    self.sep_token: 5,
									}
									UpperCAmelCase__			 =				len(self.special_tokens_encoder     )
									UpperCAmelCase__			 =				{v: k for k, v in self.special_tokens_encoder.items()}







					def 						__lowerCAmelCase		(							self  :      List[str]     ):
									UpperCAmelCase__			 =				self.special_tokens_encoder.copy()
									vocab.update(self.added_tokens_encoder     )
									for i in range(self._utf_vocab_size     ):
													UpperCAmelCase__			 =				chr(__SCREAMING_SNAKE_CASE     )
													UpperCAmelCase__			 =				i + len(self.special_tokens_encoder     )
									return vocab







					@property
					def 						__lowerCAmelCase		(							self  :      str     ):
									return self._utf_vocab_size + self._num_special_tokens







					def 						__lowerCAmelCase		(							self  :      List[str]       ,lowerCamelCase__  :      List[int]       ,lowerCamelCase__  :      Optional[List[int]] = None       ,lowerCamelCase__  :      bool = False     ):
									if already_has_special_tokens:
													return super().get_special_tokens_mask(
													    token_ids_a=__SCREAMING_SNAKE_CASE       ,token_ids_a=__SCREAMING_SNAKE_CASE       ,already_has_special_tokens=__SCREAMING_SNAKE_CASE     )

									# normal case: some special tokens
									if token_ids_a is None:
													return [1] + [0] * len(__SCREAMING_SNAKE_CASE     ) + [1]
									return [1] + ([0] * len(__SCREAMING_SNAKE_CASE     )) + [1] + ([0] * len(__SCREAMING_SNAKE_CASE     )) + [1]







					def 						__lowerCAmelCase		(							self  :      Optional[int]       ,lowerCamelCase__  :      List[int]       ,lowerCamelCase__  :      Optional[List[int]] = None     ):
									if token_ids_a is None:
													return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
									else:
													return [self.cls_token_id] + token_ids_a + [self.sep_token_id] + token_ids_a + [self.sep_token_id]







					def 						__lowerCAmelCase		(							self  :      Optional[int]       ,lowerCamelCase__  :      str     ):
									UpperCAmelCase__			 =				[chr(__SCREAMING_SNAKE_CASE     ) for i in text.encode('utf-8'     )]
									return tokens







					def 						__lowerCAmelCase		(							self  :      str       ,lowerCamelCase__  :      Optional[int]     ):
									if token in self.special_tokens_encoder:
													UpperCAmelCase__			 =				self.special_tokens_encoder[token]
									elif token in self.added_tokens_encoder:
													UpperCAmelCase__			 =				self.added_tokens_encoder[token]
									elif len(__SCREAMING_SNAKE_CASE     ) != 1:
													UpperCAmelCase__			 =				self.unk_token_id
									else:
													UpperCAmelCase__			 =				ord(__SCREAMING_SNAKE_CASE     ) + self._num_special_tokens
									return token_id







					def 						__lowerCAmelCase		(							self  :      List[Any]       ,lowerCamelCase__  :      List[Any]     ):
									if index in self.special_tokens_decoder:
													UpperCAmelCase__			 =				self.special_tokens_decoder[index]
									elif index in self.added_tokens_decoder:
													UpperCAmelCase__			 =				self.added_tokens_decoder[index]
									else:
													UpperCAmelCase__			 =				chr(index - self._num_special_tokens     )
									return token







					def 						__lowerCAmelCase		(							self  :      Optional[int]       ,lowerCamelCase__  :      Optional[int]     ):
									UpperCAmelCase__			 =				b''
									for token in tokens:
													if token in self.special_tokens_decoder:
																	UpperCAmelCase__			 =				self.special_tokens_decoder[token].encode('utf-8'     )
													elif token in self.added_tokens_decoder:
																	UpperCAmelCase__			 =				self.special_tokens_decoder[token].encode('utf-8'     )
													elif token in self.special_tokens_encoder:
																	UpperCAmelCase__			 =				token.encode('utf-8'     )
													elif token in self.added_tokens_encoder:
																	UpperCAmelCase__			 =				token.encode('utf-8'     )
													else:
																	UpperCAmelCase__			 =				bytes([ord(__SCREAMING_SNAKE_CASE     )]     )
													bstring += tok_string
									UpperCAmelCase__			 =				bstring.decode('utf-8'       ,errors='replace'     )
									return string







					def 						__lowerCAmelCase		(							self  :      Any       ,lowerCamelCase__  :      str       ,lowerCamelCase__  :      Optional[str] = None     ):
									return ()






"""simple docstring"""




import sys

sys.set_int_max_str_digits(0)  # type: ignore
def   __SCREAMING_SNAKE_CASE		(		lowercase__ ):
					"""simple docstring"""
					A     =   [0] * 11
					A     =   [0] * 11

					# mark last 9 numbers
					for _ in range(9 ):
										A     =   1
										A     =   number // 10
					# flag
					A     =   True

					# check last 9 numbers for pandigitality

					for x in range(9 ):
										if not check_last[x + 1]:
															A     =   False
					if not f:
										return f

					# mark first 9 numbers
					A     =   int(str(lowercase__ )[:9] )

					for _ in range(9 ):
										A     =   1
										A     =   number // 10

					# check first 9 numbers for pandigitality

					for x in range(9 ):
										if not check_front[x + 1]:
															A     =   False
					return f
def   __SCREAMING_SNAKE_CASE		(		lowercase__ ):
					"""simple docstring"""
					A     =   [0] * 11

					# mark last 9 numbers
					for _ in range(9 ):
										A     =   1
										A     =   number // 10
					# flag
					A     =   True

					# check last 9 numbers for pandigitality

					for x in range(9 ):
										if not check_last[x + 1]:
															A     =   False
					return f
def   __SCREAMING_SNAKE_CASE		(		):
					"""simple docstring"""
					A     =   1
					A     =   1
					A     =   2
					# temporary Fibonacci numbers

					A     =   1
					A     =   1
					A     =   2
					# temporary Fibonacci numbers mod 1e9

					# mod m=1e9, done for fast optimisation
					A     =   [0] * 1_000_000
					A     =   1_000_000_000

					for x in range(1_000_000 ):
										A     =   (aa + ba) % m
										A     =   ba % m
										A     =   ca % m
										if checka(lowercase__ ):
															A     =   1

					for x in range(1_000_000 ):
										A     =   a + b
										A     =   b
										A     =   c
										# perform check only if in tocheck
										if tocheck[x + 3] and check(lowercase__ ):
															return x + 3  # first 2 already done
					return -1


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





