Cubes and rectangles