'''simple docstring'''





from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


SCREAMING_SNAKE_CASE :	List[Any]							     =		{"""configuration_focalnet""": ["""FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP""", """FocalNetConfig"""]}


try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  SCREAMING_SNAKE_CASE :	Any							     =		[
      """FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """FocalNetForImageClassification""",
      """FocalNetForMaskedImageModeling""",
      """FocalNetBackbone""",
      """FocalNetModel""",
      """FocalNetPreTrainedModel""",
  ]

if TYPE_CHECKING:
  from .configuration_focalnet import FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP, FocalNetConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_focalnet import (
        FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST,
        FocalNetBackbone,
        FocalNetForImageClassification,
        FocalNetForMaskedImageModeling,
        FocalNetModel,
        FocalNetPreTrainedModel,
    )

else:
  import sys

  SCREAMING_SNAKE_CASE :	List[Any]							     =		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



from __future__ import annotations

SCREAMING_SNAKE_CASE :	Optional[int]							     =		[]



def   __A		(			_A							,				_A							,				_A					):



 """simple docstring"""


 for i in range(len(_A					)					):
  if board[row][i] == 1:
   return False
 for i in range(len(_A					)					):
  if board[i][column] == 1:
   return False
 for i, j in zip(range(_A							,				-1							,				-1					)							,				range(_A							,				-1							,				-1					)					):
  if board[i][j] == 1:
   return False
 for i, j in zip(range(_A							,				-1							,				-1					)							,				range(_A							,				len(_A					)					)					):
  if board[i][j] == 1:
   return False
 return True



def   __A		(			_A							,				_A					):



 """simple docstring"""


 if row >= len(_A					):
  solution.append(_A					)
  printboard(_A					)
  print()
  return True
 for i in range(len(_A					)					):
  if is_safe(_A							,				_A							,				_A					):
   __a       =  1
   solve(_A							,				row + 1					)
   __a       =  0
 return False



def   __A		(			_A					):



 """simple docstring"""


 for i in range(len(_A					)					):
  for j in range(len(_A					)					):
   if board[i][j] == 1:
    print("Q"							,				end=" "					)
   else:
    print("."							,				end=" "					)
  print()


# n=int(input("The no. of queens"))
SCREAMING_SNAKE_CASE :	List[str]							     =		8
SCREAMING_SNAKE_CASE :	str							     =		[[0 for i in range(n)] for j in range(n)]
solve(board, 0)






print("""The total no. of solutions are :""", len(solution))


