plz hlp me how to generate combinations

hi all.
hlp me how to handle this one.
I have n number of sets
Each set contains characters

like

set1 : a,s,a
set2 : b,d,c
set3 : c


how can i get all the possible combinations so that
first letter from first set and second number from second set. like that.
there is a possibility of n number of sets and set are independent.

my required output in this case id

asa
bsa
csa
ada
bda
cda
asc
bsc
csc
adc
bdc
cdc


please provide me a solution
Topic archived. No new replies allowed.