The top left div is first in painting order because it's the first in document order, so it will be affected by both of the following exclusions in both cases. To repeat, the top left div is first in painting order because it's the first in document order, so it will be affected by both of the following exclusions in both cases.
The middle div would normally be in the middle in painting order, so it would only be affected by the last exclusion. But if we change it's z-index to paint last, then its exclusion applies first.
The bottom right div would normally not be affected by either of the previous divs, but when the middle div is changed to paint after the bottom right div, then the bottom right div becomes affected by the middle exclusion.