'''simple docstring'''




def _UpperCamelCase (							SCREAMING_SNAKE_CASE_	,							SCREAMING_SNAKE_CASE_	,							SCREAMING_SNAKE_CASE_	,							SCREAMING_SNAKE_CASE_				):
     return len_board * len_board_column * row + column

def _UpperCamelCase (							SCREAMING_SNAKE_CASE_	,							SCREAMING_SNAKE_CASE_	,							SCREAMING_SNAKE_CASE_	,							SCREAMING_SNAKE_CASE_	,							SCREAMING_SNAKE_CASE_	,							SCREAMING_SNAKE_CASE_	,							):

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

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

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

          lowercase_       :							Optional[int]  					=       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 (							SCREAMING_SNAKE_CASE_	,							SCREAMING_SNAKE_CASE_				):
     lowercase_       :							int  					=       (
         'The board should be a non empty matrix of single chars strings.'
     )

     lowercase_       :							Union[str, 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.'				)

     lowercase_       :							Any  					=       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()







def  _snake_case		(snake_case_					:     int = 100    ,       snake_case_					:     int = 100  )							->		int:
  return max(
      sum(int(snake_case_  ) for x in str(base**power  )  )
      for base in range(snake_case_  )
      for power in range(snake_case_  )  )


# Tests
if __name__ == "__main__":
      import doctest

      doctest.testmod()





