
def 					__lowerCAmelCase    (    a__		,					a__		,					a__		,					a__						) ->						int:
				return len_board * len_board_column * row + column


def 					__lowerCAmelCase    (    a__		,					a__		,					a__		,					a__		,					a__		,					a__		,					) ->						bool:

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

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

				__a    							=					[(0, 1), (0, -1), (-1, 0), (1, 0)]
				__a    							=					len(a__						)
				__a    							=					len(board[0]						)
				for direction in traverts_directions:
								__a    							=					row + direction[0]
								__a    							=					column + direction[1]
								if not (0 <= next_i < len_board and 0 <= next_j < len_board_column):
												continue

								__a    							=					get_point_key(a__		,					a__		,					a__		,					a__						)
								if key in visited_points_set:
												continue

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

								visited_points_set.remove(a__						)

				return False


def 					__lowerCAmelCase    (    a__		,					a__						) ->						bool:
				__a    							=					(
				    '''The board should be a non empty matrix of single chars strings.'''
				)

				__a    							=					len(a__						)
				if not isinstance(a__		,					a__						) or len(a__						) == 0:
								raise ValueError(a__						)

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

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

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

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

				return False


if __name__ == "__main__":
					import doctest

					doctest.testmod()

def 					__lowerCAmelCase    (    a__ = 99_8001						) ->						int:
				__a    							=					0
				for i in range(999		,					99		,					-1						):  # 3 digit numbers range from 999 down to 100
								for j in range(999		,					99		,					-1						):
												__a    							=					str(i * j						)
												if product_string == product_string[::-1] and i * j < n:
																__a    							=					max(a__		,					i * j						)
				return answer


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