'''simple docstring'''




from __future__ import annotations

_a   :	int 							=   []

def _lowercase	(      lowerCamelCase__							,    lowerCamelCase__							,    lowerCamelCase__						)					->       bool:





       """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 _lowercase	(      lowerCamelCase__							,    lowerCamelCase__						)					->       bool:





       """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__						):
                     __UpperCAmelCase  :				Tuple       				=		1
                     solve(lowerCamelCase__							,    row + 1						)
                     __UpperCAmelCase  :				Tuple       				=		0
       return False

def _lowercase	(      lowerCamelCase__						)					->       None:





       """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"))
_a   :	Any 							=   8
_a   :	Dict 							=   [[0 for i in range(n)] for j in range(n)]
solve(board, 0)

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







'''simple docstring'''




def _lowercase	(      lowerCamelCase__							,    lowerCamelCase__						)					->       int:





       """simple docstring"""


       return number | (1 << position)

def _lowercase	(      lowerCamelCase__							,    lowerCamelCase__						)					->       int:





       """simple docstring"""


       return number & ~(1 << position)

def _lowercase	(      lowerCamelCase__							,    lowerCamelCase__						)					->       int:





       """simple docstring"""


       return number ^ (1 << position)

def _lowercase	(      lowerCamelCase__							,    lowerCamelCase__						)					->       bool:





       """simple docstring"""


       return ((number >> position) & 1) == 1

def _lowercase	(      lowerCamelCase__							,    lowerCamelCase__						)					->       int:





       """simple docstring"""


       return int((number & (1 << position)) != 0						)


if __name__ == "__main__":
   import doctest

   doctest.testmod()






