9.87 Given that among the 48 square faces of 8 unit cubes, $n$ of them are painted black, and the rest are painted white. Using these 8 unit cubes, it is always possible to construct a larger cube such that on its surface, the 24 unit squares are equally divided into black and white. Find all possible values of $n$.

Construct the text in English, preserving the original text's line breaks and format, and output the translation directly.
[Solution] First, we color 8 unit cubes as follows: the first 5 cubes each have 2 white faces and 4 black faces, with the two white faces opposite each other; the 6th cube is painted with 2 black faces and 4 white faces, with the two black faces opposite each other; the last two cubes are painted entirely white. At this point, among the 48 surface squares of the 8 cubes, there are 22 black and 26 white. Since in the above coloring method, black faces are opposite black faces, and white faces are opposite white faces, no matter how the large cube is constructed, there will always be exactly 11 black squares and 13 white squares on its surface, which does not meet the requirements of the problem. Therefore, $n \geqslant 23$. Similarly, it can be proven that $n \leqslant 25$.

Next, we will prove that when $23 \leqslant n \leqslant 25$, it is always possible to construct a large cube that meets the requirements.

First, arrange the 8 unit cubes in some way to form a large cube. Clearly, we only need to consider the case where it does not meet the requirements of the problem. Assume, without loss of generality, that the number of black squares on the surface, $m \leqslant 11$.

Then note that when any unit cube is rotated $90^{\circ}$ about an axis through its center and perpendicular to a pair of opposite faces, one of the unit squares originally on the surface of the large cube will move to the interior, and the unit square opposite to it will move from the interior to the surface. Therefore, under this operation, the change in $m$ is one of $1, 0, -1$. Since it is always possible to perform 3 rotations about different axes on a unit cube to swap 3 surface squares with 3 internal squares, it is always possible to use 24 rotations to swap all 24 surface squares of the large cube with the internal ones. At this point, the number of black unit squares on the surface of the large cube is $m^{\prime}=n-m \geqslant 12$. If $m^{\prime}=12$, the problem is solved. Assume $m^{\prime}>12$ below. Let the number of black squares on the surface after the $i$-th rotation be $m_{i}$, then $\left|m_{i+1}-m_{i}\right| \leqslant 1$. Since $m_{0}=m \leqslant 11, m_{24}=m^{\prime}>12$, it follows that there must be an $m_{i_{0}}, 1 \leqslant i_{0} \leqslant 23$, such that $m_{i_{0}}=12$. Therefore, after $i_{0}$ rotations, the cube obtained meets the requirements.
In summary, the possible values of $n$ are 23, 24, and 25.