def smallest_diff_key(A, B):
    """return the smallest key adiff in A such that A[adiff] != B[bdiff]"""
    diff_keys = [k for k in A if k not in B or A.get(k) != B.get(k)]
    if (len(diff_keys)) != 0:
        return min(diff_keys)
    else:
        return None