That's a tough issue. Since both are applicable to Z, it's possible that their technologies might converge and you might find yourself writing a threatening letter to yourself with veiled threats of patent litigation.
I've had my work for one client cited against another client (and have cited my prior work for other clients in IDSes). I don't think that's the test. Once you've written an application for ABCD, that can be cited for any technology that includes A, B, C, or D.
On the other side of the fuzzy line here is the possibility that you might find yourself tempted to write a claim for one client in such a manner that avoids or ensures infringement by another client. Your inside knowledge of one client should never affect your work for another client. So, if you have to determine whether to have a dependent claim for Client B to cover ABEF+CD, you really shouldn't be in that position. Even trashing one client's approach in the Background section should make you feel a bit uncomfortable, though you often have to do that for improvement innovations for a given client, trashing (politely) their earlier work.
Lastly, even if there's no conflict now, what happens when Client A says the following? "Hey, we have a totally new approach that we've been working on. We're dropping the ABCD approach and have this great new approach based on ABEF." I've seen these sea changes in a client's technology and have at least once been worried that it was approaching the work of another client (but it turned out not to be true). Of course, some of those sea changes are completely unpredictable and you just have to deal with it. However, the closer the technology between clients, the more likely a change in direction of one or both will give rise to a conflict you'd have to deal with.
Sorry I couldn't draw a brighter line. I hope that helps.
Regards.