I think we need to look at both the cases; Hillary coming first, then Obama coming first. The variable Z = B - H, I think is just a hint for one of the cases.
But also 'Z' should take care of both the possibilities while solving the cases. It leads to the same answer. I do not think it matters which one comes first eventually. Can somebody confirm that?