from string import ascii_uppercase

lowerCAmelCase			:							Optional[Any]     ={str(ord(c) - 55): c for c in ascii_uppercase}







def 						A__  (					__A   , __A	):







				'''simple docstring'''
				if isinstance(lowerCAmelCase__   , lowerCAmelCase__	):
								raise TypeError("""int() can't convert non-string with explicit base"""	)
				if num < 0:
								raise ValueError("""parameter must be positive int"""	)
				if isinstance(lowerCAmelCase__   , lowerCAmelCase__	):
								raise TypeError("""'str' object cannot be interpreted as an integer"""	)
				if isinstance(lowerCAmelCase__   , lowerCAmelCase__	):
								raise TypeError("""'float' object cannot be interpreted as an integer"""	)
				if base in (0, 1):
								raise ValueError("""base must be >= 2"""	)
				if base > 36:
								raise ValueError("""base must be <= 36"""	)
				_lowerCamelCase     :		Union[str, Any] 						=						""""""
				_lowerCamelCase     :		Optional[Any] 						=						0
				_lowerCamelCase     :		Any 						=						0
				while div != 1:
								_lowerCamelCase						,							_lowerCamelCase     :		Optional[Any] 						=						divmod(lowerCAmelCase__   , lowerCAmelCase__	)
								if base >= 11 and 9 < mod < 36:
												_lowerCamelCase     :		Union[str, Any] 						=						ALPHABET_VALUES[str(lowerCAmelCase__	)]
								else:
												_lowerCamelCase     :		Optional[int] 						=						str(lowerCAmelCase__	)
								new_value += actual_value
								_lowerCamelCase     :		Dict 						=						num // base
								_lowerCamelCase     :		Dict 						=						div
								if div == 0:
												return str(new_value[::-1]	)
								elif div == 1:
												new_value += str(lowerCAmelCase__	)
												return str(new_value[::-1]	)

				return new_value[::-1]


if __name__ == "__main__":
				import doctest

				doctest.testmod()

				for base in range(2, 37):
								for num in range(1000):
												assert int(decimal_to_any(num, base), base) == num, (
												    num,
												    base,
												    decimal_to_any(num, base),
												    int(decimal_to_any(num, base), base),
												)





from __future__ import annotations

lowerCAmelCase			:							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	):
            _lowerCamelCase     :		int 						=						1
            solve(__A   , row + 1	)
            _lowerCamelCase     :		List[str] 						=						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"))
lowerCAmelCase			:							int     =8
lowerCAmelCase			:							Union[str, Any]     =[[0 for i in range(n)] for j in range(n)]
solve(board, 0)
print("The total no. of solutions are :", len(solution))




