A theorem on cubes