





'''simple docstring'''






from __future__ import annotations

from typing import Any






def   __A    (				a_    :	list[Any]						):
		create_state_space_tree(a_   ,[]   ,0						)






def   __A    (				a_    :	list[Any]   ,a_    :	list[Any]   ,a_    :	int						):

		if index == len(a_						):
				print(a_						)
				return

		create_state_space_tree(a_   ,a_   ,index + 1						)
		current_subsequence.append(sequence[index]						)
		create_state_space_tree(a_   ,a_   ,index + 1						)
		current_subsequence.pop()


if __name__ == "__main__":
					lowerCAmelCase									=   [3, 1, 2, 4]
					generate_all_subsequences(seq)

					seq.clear()
					seq.extend(["""A""", """B""", """C"""])
					generate_all_subsequences(seq)










'''simple docstring'''






from __future__ import annotations

lowerCAmelCase									=   []






def   __A    (				a_    :	list[list[int]]   ,a_    :	int   ,a_    :	int						):
		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_    :	list[list[int]]   ,a_    :	int						):
		if row >= len(a_						):
				solution.append(a_						)
				printboard(a_						)
				print()
				return True
		for i in range(len(a_						)						):
				if is_safe(a_   ,a_   ,a_						):
						lowerCAmelCase  :     Dict       						= 1
						solve(a_   ,row + 1						)
						lowerCAmelCase  :     Optional[int]       						= 0
		return False






def   __A    (				a_    :	list[list[int]]						):
		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"))
lowerCAmelCase									=   8
lowerCAmelCase									=   [[0 for i in range(n)] for j in range(n)]
solve(board, 0)

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



