


'''simple docstring'''


def       snake_case_       (  SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__					):







				"""simple docstring"""





				return len_board * len_board_column * row + column







def       snake_case_       (  SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__							,				):







				"""simple docstring"""





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

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

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

								_SCREAMING_SNAKE_CASE			:	Optional[int]							=				get_point_key(SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__					)
								if key in visited_points_set:
												continue

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

								visited_points_set.remove(SCREAMING_SNAKE_CASE__					)

				return False







def       snake_case_       (  SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__					):







				"""simple docstring"""





				_SCREAMING_SNAKE_CASE			:	List[str]							=				(
				    """The board should be a non empty matrix of single chars strings."""
				)

				_SCREAMING_SNAKE_CASE			:	List[str]							=				len(SCREAMING_SNAKE_CASE__					)
				if not isinstance(SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__					) or len(SCREAMING_SNAKE_CASE__					) == 0:
								raise ValueError(SCREAMING_SNAKE_CASE__					)

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

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

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

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

				return False


if __name__ == "__main__":
				import doctest

				doctest.testmod()








'''simple docstring'''


def       snake_case_       (  SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__					):







				"""simple docstring"""





				_SCREAMING_SNAKE_CASE			:	Tuple							=				1
				while b > 0:
								if b & 1:
												res *= a

								a *= a
								b >>= 1

				return res







def       snake_case_       (  SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__							,				SCREAMING_SNAKE_CASE__					):







				"""simple docstring"""





				_SCREAMING_SNAKE_CASE			:	Union[str, Any]							=				1
				while b > 0:
								if b & 1:
												_SCREAMING_SNAKE_CASE			:	Tuple							=				((res % c) * (a % c)) % c

								a *= a
								b >>= 1

				return res




