The set {1,2,...16} is to be split into two disjoint non-empty sets S and T in such a way that;

the product (mod 17) of any two elements of S lies in S;

the product (mod 17) of any two elements of T lies in S;

the product (mod 17) of any elements of S and any element of T lies in T.

Prove that the ONLY solution is

S={1,2,4,8,9,13,15,16} and T={3,5,6,7,10,11,12,14}.

I'd also like to know if there is a way to generalise this?