I am trying to figure out the sex-determination of a *very* foreign form of reproduction.

A species has three sexes X, Y, and Z. X produces X gametes, Y produces Y gametes, Z produces Z gametes. They do not correspond to male or female, as any may impregnate or be impregnated. Only two parents of different sexes are needed to reproduce, because the only possible combinations of gamete fusion are X and Y, or X and Z, or Y and Z. The offspring may be any sex, including the one that neither of their parents are. Sex is determined genetically, not by environmental factors.

**How does the zygote determine whether to be X, Y or Z?**

(Based on this: <https://paperiapina.deviantart.com/gallery/31840163/Triaformica>)