insert element in every position of nested list <p>In Maple 15, I have a nested list like this one (only 2 levels of nesting):</p> <pre><code>[[a,b],[c],[d,e,f]] </code></pre> <p>I want to create 6 lists from that one (the number of elements..), like these:</p> <pre><code>[[x,a,b],[c],[d,e,f]] [[a,x,b],[c],[d,e,f]] [[a,b],[x,c],[d,e,f]] [[a,b],[c],[x,d,e,f]] [[a,b],[c],[d,x,e,f]] [[a,b],[c],[d,e,x,f]] </code></pre> <p>I tried but I have super complex loops and it doesn't work.. any more brilliant idea?</p>