Thanks for the reply, so for example A={0,1}, B={2,3,4}, C={5,6}, D={7,8,9}. So one combination would be 0257 0258 0259 0267 0268 0269, and so on with 03.., 04.. 12..,13..14.. and also 2075 or 31 76 .. and so on.. i hope i am making sense now? The elements from A and B have to take the first two...