'''simple docstring'''


from __future__ import annotations

def   A_      (       SCREAMING_SNAKE_CASE_						)			->bool:
  lowercase_     =       len(SCREAMING_SNAKE_CASE_						)
  # We need to create solution object to save path.
  lowercase_     =       [[0 for _ in range(SCREAMING_SNAKE_CASE_						)] for _ in range(SCREAMING_SNAKE_CASE_						)]
  lowercase_     =       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   A_      (       SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_						)			->bool:
  lowercase_     =       len(SCREAMING_SNAKE_CASE_						)
  # Final check point.
  if i == j == (size - 1):
    lowercase_     =       1
    return True

  lowercase_     =       (not i < 0) and (not j < 0)  # Check lower bounds
  lowercase_     =       (i < size) and (j < size)  # Check upper bounds

  if lower_flag and upper_flag:
    # check for already visited and block points.
    lowercase_     =       (not solutions[i][j]) and (not maze[i][j])
    if block_flag:
      # check visited
      lowercase_     =       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

      lowercase_     =       0
      return False
  return False


if __name__ == "__main__":
       import doctest

       doctest.testmod()


'''simple docstring'''


def   A_      (       SCREAMING_SNAKE_CASE_						)			->bool:
  if number < 0:
    raise ValueError("""number must not be negative"""						)
  return number & (number - 1) == 0


if __name__ == "__main__":
       import doctest

       doctest.testmod()

