

import sys

sys.set_int_max_str_digits(0)  # type: ignore







def _a					(			SCREAMING_SNAKE_CASE						:     int						)       ->       bool:

 """simple docstring"""






 __lowerCAmelCase:  Optional[int]        = [0] * 11
 __lowerCAmelCase:  Union[str, Any]        = [0] * 11

 # mark last 9 numbers
 for _ in range(9						):
  __lowerCAmelCase:  List[Any]        = 1
  __lowerCAmelCase:  Any        = number // 10
 # flag
 __lowerCAmelCase:  List[str]        = True

 # check last 9 numbers for pandigitality

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

 # mark first 9 numbers
 __lowerCAmelCase:  Union[str, Any]        = int(str(SCREAMING_SNAKE_CASE						)[:9]						)

 for _ in range(9						):
  __lowerCAmelCase:  List[str]        = 1
  __lowerCAmelCase:  Any        = number // 10

 # check first 9 numbers for pandigitality

 for x in range(9						):
  if not check_front[x + 1]:
   __lowerCAmelCase:  Union[str, Any]        = False
 return f







def _a					(			SCREAMING_SNAKE_CASE						:     int						)       ->       bool:

 """simple docstring"""






 __lowerCAmelCase:  List[Any]        = [0] * 11

 # mark last 9 numbers
 for _ in range(9						):
  __lowerCAmelCase:  int        = 1
  __lowerCAmelCase:  Optional[int]        = number // 10
 # flag
 __lowerCAmelCase:  Dict        = True

 # check last 9 numbers for pandigitality

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







def _a					(			)       ->       int:

 """simple docstring"""






 __lowerCAmelCase:  Dict        = 1
 __lowerCAmelCase:  Dict        = 1
 __lowerCAmelCase:  Optional[Any]        = 2
 # temporary Fibonacci numbers

 __lowerCAmelCase:  Union[str, Any]        = 1
 __lowerCAmelCase:  Union[str, Any]        = 1
 __lowerCAmelCase:  Any        = 2
 # temporary Fibonacci numbers mod 1e9

 # mod m=1e9, done for fast optimisation
 __lowerCAmelCase:  Union[str, Any]        = [0] * 1_00_00_00
 __lowerCAmelCase:  List[Any]        = 10_00_00_00_00

 for x in range(1_00_00_00						):
  __lowerCAmelCase:  Dict        = (aa + ba) % m
  __lowerCAmelCase:  str        = ba % m
  __lowerCAmelCase:  str        = ca % m
  if checka(SCREAMING_SNAKE_CASE						):
   __lowerCAmelCase:  Any        = 1

 for x in range(1_00_00_00						):
  __lowerCAmelCase:  int        = a + b
  __lowerCAmelCase:  Optional[Any]        = b
  __lowerCAmelCase:  List[Any]        = c
  # perform check only if in tocheck
  if tocheck[x + 3] and check(SCREAMING_SNAKE_CASE						):
   return x + 3  # first 2 already done
 return -1


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








def _a					(			SCREAMING_SNAKE_CASE						:     int						)       ->       int:

 """simple docstring"""






 return n * (2 * n - 1)







def _a					(			SCREAMING_SNAKE_CASE						:     int						)       ->       bool:

 """simple docstring"""






 __lowerCAmelCase:  List[Any]        = (1 + 24 * n) ** 0.5
 return ((1 + root) / 6) % 1 == 0







def _a					(			SCREAMING_SNAKE_CASE						:     int = 1_44						)       ->       int:

 """simple docstring"""






 __lowerCAmelCase:  Dict        = start
 __lowerCAmelCase:  List[str]        = hexagonal_num(SCREAMING_SNAKE_CASE						)
 while not is_pentagonal(SCREAMING_SNAKE_CASE						):
  n += 1
  __lowerCAmelCase:  Any        = hexagonal_num(SCREAMING_SNAKE_CASE						)
 return num


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





