Let A and B be two sets such that n(A) = 3 and n(B) = 2. If (x, 1), (y, 2), (z, 1)\) are in A×B, find A and B, where x,y,z are distinct elements.