




import sys

sys.set_int_max_str_digits(0)  # type: ignore







def      _UpperCamelCase	(_lowerCamelCase							:       int		)->				bool:




     '''simple docstring'''





     __snake_case         =					[0] * 11
     __snake_case         =					[0] * 11

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

     # check last 9 numbers for pandigitality

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

     # mark first 9 numbers
     __snake_case         =					int(str(_lowerCamelCase		)[:9]		)

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

     # check first 9 numbers for pandigitality

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







def      _UpperCamelCase	(_lowerCamelCase							:       int		)->				bool:




     '''simple docstring'''





     __snake_case         =					[0] * 11

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

     # check last 9 numbers for pandigitality

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







def      _UpperCamelCase	()->				int:




     '''simple docstring'''





     __snake_case         =					1
     __snake_case         =					1
     __snake_case         =					2
     # temporary Fibonacci numbers

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

     # mod m=1e9, done for fast optimisation
     __snake_case         =					[0] * 1_00_00_00
     __snake_case         =					10_00_00_00_00

     for x in range(1_00_00_00		):
          __snake_case         =					(aa + ba) % m
          __snake_case         =					ba % m
          __snake_case         =					ca % m
          if checka(_lowerCamelCase		):
               __snake_case         =					1

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


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












'''simple docstring'''



from typing import TYPE_CHECKING

from ....utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


UpperCAmelCase_    :					Any					      =						{
    '''configuration_retribert''': ['''RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''RetriBertConfig'''],
    '''tokenization_retribert''': ['''RetriBertTokenizer'''],
}

try:
     if not is_tokenizers_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCAmelCase_    :					str					      =						['''RetriBertTokenizerFast''']

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCAmelCase_    :					Optional[int]					      =						[
         '''RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
         '''RetriBertModel''',
         '''RetriBertPreTrainedModel''',
     ]


if TYPE_CHECKING:
     from .configuration_retribert import RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RetriBertConfig
     from .tokenization_retribert import RetriBertTokenizer

     try:
          if not is_tokenizers_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_retribert_fast import RetriBertTokenizerFast

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_retribert import (
              RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
              RetriBertModel,
              RetriBertPreTrainedModel,
          )

else:
     import sys

     UpperCAmelCase_    :					Any					      =						_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






