Generating all cubes