function for getting all permutations of a set of lists of unequal lengths