






"""simple docstring"""

import logging
import os
from logging import (
    CRITICAL,  # NOQA
    DEBUG,  # NOQA
    ERROR,  # NOQA
    FATAL,  # NOQA
    INFO,  # NOQA
    NOTSET,  # NOQA
    WARN,  # NOQA
    WARNING,  # NOQA
)
from typing import Optional

from tqdm import auto as tqdm_lib


lowercase    			=       {
    '''debug''': logging.DEBUG,
    '''info''': logging.INFO,
    '''warning''': logging.WARNING,
    '''error''': logging.ERROR,
    '''critical''': logging.CRITICAL,
}

lowercase    			=       logging.WARNING






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						__magic_name__            =     os.getenv("DATASETS_VERBOSITY" ,						__lowerCamelCase   )
						if env_level_str:
												if env_level_str in log_levels:
																		return log_levels[env_level_str]
												else:
																		logging.getLogger().warning(
																		    f'''Unknown option DATASETS_VERBOSITY={env_level_str}, '''
																		    f'''has to be one of: { ", ".join(log_levels.keys()   ) }'''   )
						return _default_log_level






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						return __name__.split("."   )[0]






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						return logging.getLogger(_get_library_name()   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						__magic_name__            =     _get_library_root_logger()
						library_root_logger.setLevel(_get_default_logging_level()   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						__magic_name__            =     _get_library_root_logger()
						library_root_logger.setLevel(logging.NOTSET   )






def _lowerCAmelCase	(  __lowerCamelCase:Optional[str] = None   ):

						'''simple docstring'''






						if name is None:
												__magic_name__            =     _get_library_name()
						return logging.getLogger(__lowerCamelCase   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						return _get_library_root_logger().getEffectiveLevel()






def _lowerCAmelCase	(  __lowerCamelCase:int   ):

						'''simple docstring'''






						_get_library_root_logger().setLevel(__lowerCamelCase   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						return set_verbosity(__lowerCamelCase   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						return set_verbosity(__lowerCamelCase   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						return set_verbosity(__lowerCamelCase   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						return set_verbosity(__lowerCamelCase   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						__magic_name__            =     False






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						__magic_name__            =     True


# Configure the library root logger at the module level (singleton-like)
_configure_library_root_logger()

class 						A_							:







				def __init__(							self							:						Any						,    *__lowerCamelCase							:						Optional[int]						,    **__lowerCamelCase							:						str	)				->					List[str]:  # pylint: disable=unused-argument
										__magic_name__            =     args[0] if args else None







				def __iter__(							self							:						Tuple	)				->					Optional[int]:
										return iter(self._iterator	)







				def __getattr__(							self							:						Dict						,    __lowerCamelCase							:						Optional[int]	)				->					Optional[int]:

										def empty_fn(*__lowerCamelCase							:						Tuple						,    **__lowerCamelCase							:						Any	):  # pylint: disable=unused-argument
																return

										return empty_fn







				def __enter__(							self							:						Dict	)				->					Any:
										return self







				def __exit__(							self							:						Tuple						,    __lowerCamelCase							:						List[Any]						,    __lowerCamelCase							:						Tuple						,    __lowerCamelCase							:						Optional[Any]	)				->					Any:
										return





lowercase    			=       True

class 						A_							:







				def __call__(							self							:						List[str]						,    *__lowerCamelCase							:						Any						,    __lowerCamelCase							:						str=False						,    **__lowerCamelCase							:						List[str]	)				->					str:
										if _tqdm_active and not disable:
																return tqdm_lib.tqdm(*__lowerCamelCase						,    **__lowerCamelCase	)
										else:
																return EmptyTqdm(*__lowerCamelCase						,    **__lowerCamelCase	)







				def     _snake_case					(							self							:						str						,    *__lowerCamelCase							:						Union[str, Any]						,    **__lowerCamelCase							:						Union[str, Any]	)				->					List[str]:
										__magic_name__            =     None
										if _tqdm_active:
																return tqdm_lib.tqdm.set_lock(*__lowerCamelCase						,    **__lowerCamelCase	)







				def     _snake_case					(							self							:						List[Any]	)				->					Dict:
										if _tqdm_active:
																return tqdm_lib.tqdm.get_lock()





lowercase    			=       _tqdm_cls()






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						global _tqdm_active
						return bool(_tqdm_active   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						global _tqdm_active
						__magic_name__            =     True






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						global _tqdm_active
						__magic_name__            =     False











"""simple docstring"""

from __future__ import annotations

lowercase    			=       []






def _lowerCAmelCase	(  __lowerCamelCase:list[list[int]] ,						__lowerCamelCase:int ,						__lowerCamelCase:int   ):

						'''simple docstring'''






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






def _lowerCAmelCase	(  __lowerCamelCase:list[list[int]] ,						__lowerCamelCase:int   ):

						'''simple docstring'''






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






def _lowerCAmelCase	(  __lowerCamelCase:list[list[int]]   ):

						'''simple docstring'''






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


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


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



