8. Now we have three groups of balls, each group has $n$ balls, and the balls in each group are respectively labeled $1,2, \cdots, n$. Color the balls with black and white, ensuring that balls with the same label are the same color. If for any group of labels $a_{1} 、 a_{2} 、 a_{3} 、 a_{4}$ (which can be the same) satisfying $a_{1}+a_{2}+a_{3}=a_{4}$, there is at least one ball of each color among these three balls, then the maximum value of $n$ is $\qquad$
8. 10 .

Assuming No. 1 is black, then $1+1+1=3$. Thus, No. 3 is white.

From $3+3+3=9$, we know No. 9 is black; and $1+1+$ $7=9$, so No. 7 is also white.
From $2+2+3=7$, we know No. 2 is black.
From $1+1+2=4$, we know No. 4 is white.
From $1+2+2=5$, we know No. 5 is also white; and $2+$ $2+2=6$, so No. 6 is also white.
From $3+3+4=10$, we know No. 10 is black.
From $1+1+8=10$, we know No. 8 is white.
From $1+1+9=11$, we know No. 11 is white, and from $3+3+4=11$, we know No. 11 is black, which is a contradiction.
Therefore, the maximum value of $n$ is 10.