Devise a scheme so that a message M can be shared among X, Y and Z in such a say that the only way of recovering the message is when X is present with either Y or Z. When X isn't present or each is alone, they will not be able to recover the shared secret.
Additionally, generalize the above to devise a scheme so that a M can be shared among 5 entities such that the only way of recovering the secret is when either X and Y are both present or when C, D, E are all present together.
I have no idea how to create a hierarchy such as what is being proposed. Any ideas?