Possible cases for X are (1) 3 ladies, 0 man (2) 2 ladies, 1 man (3) 1 lady, 2 men (4) 0 ladies, 3 men Possible cases for Y are (1) 0 ladies, 3 men (2) 1 lady, 2 men (3) 2 ladies, 1 man (4) 3 ladies, 0 man No. of ways =4C3⋅4C3+(4C2⋅3C1)2+(4C1⋅3C2)2+(3C3)2 =16+324+144+1=485