


"""simple docstring"""





from __future__ import annotations


def      _snake_case						(						_snake_case				:			list[list[int]]			):
      lowerCAmelCase					:	str       =   len(_snake_case			)
      # We need to create solution object to save path.
      lowerCAmelCase					:	Tuple       =   [[0 for _ in range(_snake_case			)] for _ in range(_snake_case			)]
      lowerCAmelCase					:	List[Any]       =   run_maze(_snake_case ,   0 ,   0 ,   _snake_case			)
      if solved:
            print('''\n'''.join(str(_snake_case			) for row in solutions			)			)
      else:
            print('''No solution exists!'''			)
      return solved


def      _snake_case						(						_snake_case				:			list[list[int]] ,   _snake_case				:			int ,   _snake_case				:			int ,   _snake_case				:			list[list[int]]			):
      lowerCAmelCase					:	Optional[Any]       =   len(_snake_case			)
      # Final check point.
      if i == j == (size - 1):
            lowerCAmelCase					:	Union[str, Any]       =   1
            return True

      lowerCAmelCase					:	Optional[Any]       =   (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					:	str       =   (not solutions[i][j]) and (not maze[i][j])
            if block_flag:
                  # check visited
                  lowerCAmelCase					:	Optional[Any]       =   1

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

                  lowerCAmelCase					:	List[Any]       =   0
                  return False
      return False


if __name__ == "__main__":
 import doctest

 doctest.testmod()






"""simple docstring"""





snake_case__		:     List[Any]    				=				'''Tobias Carryer'''

from time import time



class 		snake_case_:






     def __init__(	self  :					Optional[Any]					,				UpperCamelCase_  :					Optional[Any]					,				UpperCamelCase_  :					Tuple					,				UpperCamelCase_  :					Optional[int]					,				UpperCamelCase_  :					Dict=int(time()				)				):  # noqa: B008
           lowerCAmelCase					:	str       =   multiplier
           lowerCAmelCase					:	Optional[int]       =   increment
           lowerCAmelCase					:	Optional[Any]       =   modulo
           lowerCAmelCase					:	Optional[Any]       =   seed






     def      lowerCamelCase__     (	self  :					Union[str, Any]				):
           lowerCAmelCase					:	Optional[int]       =   (self.multiplier * self.seed + self.increment) % self.modulo
           return self.seed


if __name__ == "__main__":
 # Show the LCG in action.
 snake_case__		:     int    				=				LinearCongruentialGenerator(1_664_525, 1_013_904_223, 2 << 31)
 while True:
  print(lcg.next_number())


