8. On each face of a cube, randomly fill in one of the numbers 1, 2, $\cdots$, 6 (the numbers on different faces are distinct). Then number the eight vertices such that the number assigned to each vertex is the product of the numbers on the three adjacent faces. The maximum value of the sum of the numbers assigned to the eight vertices is $\qquad$
8. 343 .

Let the numbers on the six faces be $a, b, c, d, e, f$, and $(a, b), (c, d), (e, f)$ be the numbers on the opposite faces. Thus, the sum of the numbers at the eight vertices is
$$
\begin{array}{l}
(a+b)(c+d)(e+f) \\
\leqslant\left(\frac{(a+b)+(c+d)+(e+f)}{3}\right)^{3} \\
=7^{3}=343 .
\end{array}
$$

When $a=1, b=6, c=2, d=5, e=3, f=4$, the equality holds.
Therefore, the maximum value sought is 343 .