





"""simple docstring"""
def 					A__				(			UpperCamelCase					,  UpperCamelCase       ):
							if a < 0 or b < 0:
														raise ValueError("the value of both inputs must be positive"       )

							A		=  str(bin(UpperCamelCase       )       )[2:]  # remove the leading "0b"
							A		=  str(bin(UpperCamelCase       )       )[2:]  # remove the leading "0b"

							A		=  max(len(UpperCamelCase       )					,  len(UpperCamelCase       )       )

							return "0b" + "".join(
							    str(int(char_a == "1" and char_b == "1"       )       )
							    for char_a, char_b in zip(a_binary.zfill(UpperCamelCase       )					,  b_binary.zfill(UpperCamelCase       )       )       )


if __name__ == "__main__":
		import doctest

		doctest.testmod()









"""simple docstring"""
from __future__ import annotations

_snake_case     :		str       						= []






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






def 					A__				(			UpperCamelCase					,  UpperCamelCase       ):
							if row >= len(UpperCamelCase       ):
														solution.append(UpperCamelCase       )
														printboard(UpperCamelCase       )
														print()
														return True
							for i in range(len(UpperCamelCase       )       ):
														if is_safe(UpperCamelCase					,  UpperCamelCase					,  UpperCamelCase       ):
																					A		=  1
																					solve(UpperCamelCase					,  row + 1       )
																					A		=  0
							return False






def 					A__				(			UpperCamelCase       ):
							for i in range(len(UpperCamelCase       )       ):
														for j in range(len(UpperCamelCase       )       ):
																					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     :		List[str]       						= [[0 for i in range(n)] for j in range(n)]
solve(board, 0)
print('The total no. of solutions are :', len(solution))


