

from __future__ import annotations






def    SCREAMING_SNAKE_CASE__       (  lowerCamelCase__			)  ->     Optional[int]:
	__lowerCamelCase				:				Union[str, Any]					       = len(SCREAMING_SNAKE_CASE__			)
	# We need to create solution object to save path.
	__lowerCamelCase				:				Tuple					       = [[0 for _ in range(SCREAMING_SNAKE_CASE__			)] for _ in range(SCREAMING_SNAKE_CASE__			)]
	__lowerCamelCase				:				Optional[Any]					       = run_maze(SCREAMING_SNAKE_CASE__	, 0	, 0	, SCREAMING_SNAKE_CASE__			)
	if solved:
		print('\n'.join(str(SCREAMING_SNAKE_CASE__			) for row in solutions			)			)
	else:
		print('No solution exists!'			)
	return solved






def    SCREAMING_SNAKE_CASE__       (  lowerCamelCase__	, lowerCamelCase__	, lowerCamelCase__	, lowerCamelCase__			)  ->     Optional[Any]:
	__lowerCamelCase				:				Any					       = len(SCREAMING_SNAKE_CASE__			)
	# Final check point.
	if i == j == (size - 1):
		__lowerCamelCase				:				Any					       = 1
		return True

	__lowerCamelCase				:				int					       = (not i < 0) and (not j < 0)  # Check lower bounds
	__lowerCamelCase				:				Any					       = (i < size) and (j < size)  # Check upper bounds

	if lower_flag and upper_flag:
		# check for already visited and block points.
		__lowerCamelCase				:				List[str]					       = (not solutions[i][j]) and (not maze[i][j])
		if block_flag:
			# check visited
			__lowerCamelCase				:				List[str]					       = 1

			# check for directions
			if (
			    run_maze(SCREAMING_SNAKE_CASE__	, i + 1	, SCREAMING_SNAKE_CASE__	, SCREAMING_SNAKE_CASE__			)
			    or run_maze(SCREAMING_SNAKE_CASE__	, SCREAMING_SNAKE_CASE__	, j + 1	, SCREAMING_SNAKE_CASE__			)
			    or run_maze(SCREAMING_SNAKE_CASE__	, i - 1	, SCREAMING_SNAKE_CASE__	, SCREAMING_SNAKE_CASE__			)
			    or run_maze(SCREAMING_SNAKE_CASE__	, SCREAMING_SNAKE_CASE__	, j - 1	, SCREAMING_SNAKE_CASE__			)
			):
				return True

			__lowerCamelCase				:				Any					       = 0
			return False
	return False


if __name__ == "__main__":
					import doctest

					doctest.testmod()







from ..utils import DummyObject, requires_backends





class 	snake_case_   (		metaclass=__A					):







			'''simple docstring'''

			SCREAMING_SNAKE_CASE     :   Union[str, Any]									=				["note_seq"]







			def __init__(     self :				Optional[int]							,   *_UpperCamelCase :				str							,   **_UpperCamelCase :				Optional[int]							)      ->Any:
									requires_backends(self							,   ['''note_seq''']							)







			@classmethod
			def 				snake_case__(     cls :				int							,   *_UpperCamelCase :				Any							,   **_UpperCamelCase :				List[Any]							)      ->int:
									requires_backends(cls							,   ['''note_seq''']							)







			@classmethod
			def 				snake_case__(     cls :				Dict							,   *_UpperCamelCase :				Optional[int]							,   **_UpperCamelCase :				Union[str, Any]							)      ->List[str]:
									requires_backends(cls							,   ['''note_seq''']							)