


def     lowerCAmelCase_					( __lowerCamelCase							,     __lowerCamelCase     ):
							return numa ^ numa < 0


if __name__ == "__main__":
			import doctest

			doctest.testmod()





from __future__ import annotations

_snake_case					:		Union[str, Any]      =    []







def     lowerCAmelCase_					( __lowerCamelCase							,     __lowerCamelCase							,     __lowerCamelCase     ):
							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							,     __lowerCamelCase     ):
							if row >= len(__lowerCamelCase     ):
														solution.append(__lowerCamelCase     )
														printboard(__lowerCamelCase     )
														print()
														return True
							for i in range(len(__lowerCamelCase     )     ):
														if is_safe(__lowerCamelCase							,     __lowerCamelCase							,     __lowerCamelCase     ):
																					__snake_case		:      Optional[Any]										=       1
																					solve(__lowerCamelCase							,     row + 1     )
																					__snake_case		:      Union[str, Any]										=       0
							return False







def     lowerCAmelCase_					( __lowerCamelCase     ):
							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"))
_snake_case					:		List[str]      =    8
_snake_case					:		Optional[int]      =    [[0 for i in range(n)] for j in range(n)]
solve(board, 0)

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

