



import math
from timeit import timeit





def 				A      (	_UpperCAmelCase							:  int       )							->					int:







			'''simple docstring'''
			_UpperCAmelCase									=  0
			_UpperCAmelCase									=  abs(_UpperCAmelCase       )
			while True:
						_UpperCAmelCase									=  n // 10
						digits += 1
						if n == 0:
									break
			return digits





def 				A      (	_UpperCAmelCase							:  int       )							->					int:







			'''simple docstring'''
			return 1 if n == 0 else math.floor(math.log(abs(_UpperCAmelCase       )				,  10       ) + 1       )





def 				A      (	_UpperCAmelCase							:  int       )							->					int:







			'''simple docstring'''
			return len(str(abs(_UpperCAmelCase       )       )       )





def 				A      (	)							->					None:







			'''simple docstring'''
			from collections.abc import Callable

			def benchmark_a_function(_UpperCAmelCase							:  Callable				,  _UpperCAmelCase							:  int       ) -> None:
						_UpperCAmelCase									=  F"{func.__name__}({value})"
						_UpperCAmelCase									=  timeit(F"__main__.{call}"				,  setup='import __main__'       )
						print(F"{call}: {func(_UpperCAmelCase       )} -- {timing} seconds"       )

			for value in (262_144, 1_125_899_906_842_624, 1_267_650_600_228_229_401_496_703_205_376):
						for func in (num_digits, num_digits_fast, num_digits_faster):
									benchmark_a_function(_UpperCAmelCase				,  _UpperCAmelCase       )
						print()


if __name__ == "__main__":
							import doctest

							doctest.testmod()
							benchmark()





import sys

sys.set_int_max_str_digits(0)  # type: ignore





def 				A      (	_UpperCAmelCase							:  int       )							->					bool:







			'''simple docstring'''
			_UpperCAmelCase									=  [0] * 11
			_UpperCAmelCase									=  [0] * 11

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

			# check last 9 numbers for pandigitality

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

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

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

			# check first 9 numbers for pandigitality

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





def 				A      (	_UpperCAmelCase							:  int       )							->					bool:







			'''simple docstring'''
			_UpperCAmelCase									=  [0] * 11

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

			# check last 9 numbers for pandigitality

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





def 				A      (	)							->					int:







			'''simple docstring'''
			_UpperCAmelCase									=  1
			_UpperCAmelCase									=  1
			_UpperCAmelCase									=  2
			# temporary Fibonacci numbers

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

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

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

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


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