'''simple docstring'''





from __future__ import annotations



def   __A		(			_A							,				_A							,				_A							,				_A					):  # noqa: E741



 """simple docstring"""


 while r - l > 1:
  __a       =  (l + r) // 2
  if v[m] >= key:
   __a       =  m
  else:
   __a       =  m  # noqa: E741
 return r



def   __A		(			_A					):



 """simple docstring"""


 if len(_A					) == 0:
  return 0

 __a       =  [0] * len(_A					)
 __a       =  1

 __a       =  v[0]

 for i in range(1							,				len(_A					)					):
  if v[i] < tail[0]:
   __a       =  v[i]
  elif v[i] > tail[length - 1]:
   __a       =  v[i]
   length += 1
  else:
   __a       =  v[i]

 return length


if __name__ == "__main__":
  import doctest

  doctest.testmod()



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))


