def queens_constraint(A, a, B, b):
    """ Constraint is satisfied if it's the same column (queens
        are assigned by columns), or if the queens are not in the
        same row or diagonal
    """
    if A == B:
        return True
    return a != b and A + a != B + b and A - a != B - b