Generate all possible modes of list

Possibly related: