






from __future__ import annotations

__UpperCAmelCase							:   Any							=  []





def 					lowercase_ (    __snake_case     :							list[list[int]]	,	__snake_case     :							int	,	__snake_case     :							int      )     -> bool:





				'''simple docstring'''


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





def 					lowercase_ (    __snake_case     :							list[list[int]]	,	__snake_case     :							int      )     -> bool:





				'''simple docstring'''


				if row >= len(__snake_case      ):
								solution.append(__snake_case      )
								printboard(__snake_case      )
								print()
								return True
				for i in range(len(__snake_case      )      ):
								if is_safe(__snake_case	,	__snake_case	,	__snake_case      ):
												snake_case__      :Union[str, Any]         =   1
												solve(__snake_case	,	row + 1      )
												snake_case__      :int         =   0
				return False





def 					lowercase_ (    __snake_case     :							list[list[int]]      )     -> None:





				'''simple docstring'''


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


# n=int(input("The no. of queens"))
__UpperCAmelCase							:   Tuple							=  8
__UpperCAmelCase							:   Optional[Any]							=  [[0 for i in range(n)] for j in range(n)]
solve(board, 0)
print("The total no. of solutions are :", len(solution))







def 					lowercase_ (    __snake_case     :							str      )     -> list:





				'''simple docstring'''


				return [
				    txt[:a] + txt[a].upper() + txt[a + 1 :]
				    for a in range(len(__snake_case      )      )
				    if txt[a].isalpha()
				]


if __name__ == "__main__":
	__import__("doctest").testmod()