




'''simple docstring'''





def 					UpperCamelCase						(	snake_case						,  snake_case						,  snake_case						,  snake_case ):




   '''simple docstring'''

   return len_board * len_board_column * row + column


def 					UpperCamelCase						(	snake_case						,  snake_case						,  snake_case						,  snake_case						,  snake_case						,  snake_case						,  ):




   '''simple docstring'''

   if board[row][column] != word[word_index]:
      return False

   if word_index == len(snake_case ) - 1:
      return True

   SCREAMING_SNAKE_CASE__      :					Dict							    =			[(0, 1), (0, -1), (-1, 0), (1, 0)]
   SCREAMING_SNAKE_CASE__      :					Tuple							    =			len(snake_case )
   SCREAMING_SNAKE_CASE__      :					Any							    =			len(board[0] )
   for direction in traverts_directions:
      SCREAMING_SNAKE_CASE__      :					List[str]							    =			row + direction[0]
      SCREAMING_SNAKE_CASE__      :					List[str]							    =			column + direction[1]
      if not (0 <= next_i < len_board and 0 <= next_j < len_board_column):
         continue

      SCREAMING_SNAKE_CASE__      :					Optional[Any]							    =			get_point_key(snake_case						,  snake_case						,  snake_case						,  snake_case )
      if key in visited_points_set:
         continue

      visited_points_set.add(snake_case )
      if exits_word(snake_case						,  snake_case						,  snake_case						,  snake_case						,  word_index + 1						,  snake_case ):
         return True

      visited_points_set.remove(snake_case )

   return False


def 					UpperCamelCase						(	snake_case						,  snake_case ):




   '''simple docstring'''

   SCREAMING_SNAKE_CASE__      :					List[Any]							    =			(
       '''The board should be a non empty matrix of single chars strings.'''
   )

   SCREAMING_SNAKE_CASE__      :					Optional[Any]							    =			len(snake_case )
   if not isinstance(snake_case						,  snake_case ) or len(snake_case ) == 0:
      raise ValueError(snake_case )

   for row in board:
      if not isinstance(snake_case						,  snake_case ) or len(snake_case ) == 0:
         raise ValueError(snake_case )

      for item in row:
         if not isinstance(snake_case						,  snake_case ) or len(snake_case ) != 1:
            raise ValueError(snake_case )

    # Validate word
   if not isinstance(snake_case						,  snake_case ) or len(snake_case ) == 0:
      raise ValueError(
          '''The word parameter should be a string of length greater than 0.''' )

   SCREAMING_SNAKE_CASE__      :					str							    =			len(board[0] )
   for i in range(snake_case ):
      for j in range(snake_case ):
         if exits_word(
             snake_case						,  snake_case						,  snake_case						,  snake_case						,  0						,  {get_point_key(snake_case						,  snake_case						,  snake_case						,  snake_case )} ):
            return True

   return False


if __name__ == "__main__":
       import doctest

       doctest.testmod()







'''simple docstring'''





import math
from decimal import Decimal, getcontext


def 					UpperCamelCase						(	snake_case = 4_00_00_00 ):




   '''simple docstring'''

   try:
      SCREAMING_SNAKE_CASE__      :					List[Any]							    =			int(snake_case )
   except (TypeError, ValueError):
      raise TypeError('''Parameter n must be int or castable to int.''' )
   if n <= 0:
      raise ValueError('''Parameter n must be greater than or equal to one.''' )
   SCREAMING_SNAKE_CASE__      :					Optional[int]							    =			1_00
   SCREAMING_SNAKE_CASE__      :					int							    =			(Decimal(5 ) ** Decimal(0.5 ) + 1) / Decimal(2 )

   SCREAMING_SNAKE_CASE__      :					int							    =			(math.floor(math.log(n * (phi + 2)						,  snake_case ) - 1 ) // 3) * 3 + 2
   SCREAMING_SNAKE_CASE__      :					int							    =			Decimal(round(phi ** Decimal(index + 1 ) ) ) / (phi + 2)
   SCREAMING_SNAKE_CASE__      :					Any							    =			num // 2
   return int(snake_case )


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

