






from __future__ import annotations






def 	_UpperCAmelCase    (  a		:	int							)			->			Dict:





						"""simple docstring"""
						lowercase_      :   List[Any]        =			len(a							)
						# We need to create solution object to save path.
						lowercase_      :   Optional[Any]        =			[[0 for _ in range(a							)] for _ in range(a							)]
						lowercase_      :   List[str]        =			run_maze(a						,			0						,			0						,			a							)
						if solved:
												print('\n'.join(str(a							) for row in solutions							)							)
						else:
												print('No solution exists!'							)
						return solved






def 	_UpperCAmelCase    (  a		:	List[Any]						,			a		:	Optional[int]						,			a		:	Optional[int]						,			a		:	Dict							)			->			Union[str, Any]:





						"""simple docstring"""
						lowercase_      :   Any        =			len(a							)
						# Final check point.
						if i == j == (size - 1):
												lowercase_      :   Optional[int]        =			1
												return True

						lowercase_      :   int        =			(not i < 0) and (not j < 0)  # Check lower bounds
						lowercase_      :   Union[str, Any]        =			(i < size) and (j < size)  # Check upper bounds

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

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

																		lowercase_      :   str        =			0
																		return False
						return False


if __name__ == "__main__":
						import doctest

						doctest.testmod()








'''simple docstring'''

from __future__ import annotations






def 	_UpperCAmelCase    (  a		:	int = 4							)			->			list[list[int]]:





						"""simple docstring"""
						lowercase_      :   Tuple        =			abs(a							) or 4
						return [[1 + x + y * row_size for x in range(a							)] for y in range(a							)]






def 	_UpperCAmelCase    (  a		:	list[list[int]]							)			->			list[list[int]]:





						"""simple docstring"""
						return reverse_row(transpose(a							)							)
						# OR.. transpose(reverse_column(matrix))






def 	_UpperCAmelCase    (  a		:	list[list[int]]							)			->			list[list[int]]:





						"""simple docstring"""
						return reverse_row(reverse_column(a							)							)
						# OR.. reverse_column(reverse_row(matrix))






def 	_UpperCAmelCase    (  a		:	list[list[int]]							)			->			list[list[int]]:





						"""simple docstring"""
						return reverse_column(transpose(a							)							)
						# OR.. transpose(reverse_row(matrix))






def 	_UpperCAmelCase    (  a		:	list[list[int]]							)			->			list[list[int]]:





						"""simple docstring"""
						lowercase_      :   Any        =			[list(a							) for x in zip(*a							)]
						return matrix






def 	_UpperCAmelCase    (  a		:	list[list[int]]							)			->			list[list[int]]:





						"""simple docstring"""
						lowercase_      :   List[str]        =			matrix[::-1]
						return matrix






def 	_UpperCAmelCase    (  a		:	list[list[int]]							)			->			list[list[int]]:





						"""simple docstring"""
						lowercase_      :   str        =			[x[::-1] for x in matrix]
						return matrix






def 	_UpperCAmelCase    (  a		:	list[list[int]]							)			->			None:





						"""simple docstring"""
						for i in matrix:
												print(*a							)


if __name__ == "__main__":
						A:      Dict  				=				make_matrix()
						print("\norigin:\n")
						print_matrix(matrix)
						print("\nrotate 90 counterclockwise:\n")
						print_matrix(rotate_aa(matrix))

						A:      List[Any]  				=				make_matrix()
						print("\norigin:\n")
						print_matrix(matrix)
						print("\nrotate 180:\n")
						print_matrix(rotate_aaa(matrix))

						A:      List[str]  				=				make_matrix()
						print("\norigin:\n")
						print_matrix(matrix)
						print("\nrotate 270 counterclockwise:\n")
						print_matrix(rotate_aaa(matrix))
