I also got this question correct on the test but remember being stuck between A and D. I just looked at it again and I can kind of make sense of it.
I think A is correct because it correctly restricts the first spot to either Z or W, while restricting W to the first or second spot only.
I think D is incorrect because it doesn't restrict the first spot to Z or W. It says W must be first or second, but doesn't say who must be first if W is second. So it doesn't incorporate the condition of Z into the substitution in a way that would have the same effect in determining the order.
I hope I'm allowed to say that much about the question...
Comments
I think A is correct because it correctly restricts the first spot to either Z or W, while restricting W to the first or second spot only.
I think D is incorrect because it doesn't restrict the first spot to Z or W. It says W must be first or second, but doesn't say who must be first if W is second. So it doesn't incorporate the condition of Z into the substitution in a way that would have the same effect in determining the order.
I hope I'm allowed to say that much about the question...