8. There are 128 ones written on the blackboard. In each step, you can erase any two numbers $a$ and $b$ on the blackboard, and write the number $a \cdot b + 1$. After doing this 127 times, only one number remains. Denote the maximum possible value of this remaining number as $A$. Find the last digit of $A$.


8. Let's prove that by operating on the smallest two numbers on the board at each step, we can achieve the maximum final number. For convenience, we use $a * b$ to denote the operation of removing $a$ and $b$, and immediately adding $a b + 1$. Suppose at some step we do not operate on the smallest two numbers $x$ and $y$, then before $x$ and $y$ "meet", they are combined with $x$ and $y$. That is, we have to operate on two numbers of the form $\left(\left(\cdots\left(\left(x * a_{1}\right) * a_{2}\right) \cdots\right) * a_{1}\right)$ and $\left(\left(\cdots\left(\left(y * b_{1}\right) * b_{2}\right) \cdots\right) *\right.$ $\left.b_{n}\right)$, which are respectively equal to
$$
\begin{aligned}
X & =a_{1} a_{2} \cdots a_{k}\left(x+\frac{1}{a_{1}}+\frac{1}{a_{1} a_{2}}+\cdots+\frac{1}{a_{1} a_{2} \cdots a_{k}}\right) \\
& =a_{2} \cdots a_{k}\left(a_{1} x+1+u\right), \\
Y & =b_{1} b_{2} \cdots b_{n}\left(y+\frac{1}{b_{1}}+\frac{1}{b_{1} b_{2}}+\cdots+\frac{1}{b_{1} b_{2} \cdots b_{n}}\right) \\
& =b_{1} b_{2} \cdots b_{n}(y+v),
\end{aligned}
$$

where $u>0$ and $v>0$ represent the sum of the remaining numbers in the respective parentheses. We can assume $b_{1} \leqslant b_{2} \leqslant \cdots \leqslant b_{n}$, if there is $b_{j}>b_{j+1}$, then by swapping $b_{j}$ and $b_{j+1}$, we can increase $Y$.
Now, let's swap the positions of $a_{1}$ and $y$, obtaining
$$
\begin{array}{c}
X^{\prime}=a_{2} \cdots a_{k}(x y+1+u), \\
Y^{\prime}=b_{1} b_{2} \cdots b_{n}\left(a_{1}+v\right), \text { then we have } \\
\left(X^{\prime} Y^{\prime}-1\right)-(X Y-1)=X^{\prime} Y^{\prime}-X Y \\
=a_{2} \cdots a_{k} b_{1} b_{2} \cdots b_{n}\left[(x y+1+u)\left(a_{1}+v\right)\right. \\
\left.-\left(a_{1} x+1+u\right)(y+v)\right] \\
=c\left(a_{1}-y\right)(u+1-v x),
\end{array}
$$

where $c>0, a_{1}>y, v \leqslant \frac{1}{b_{1}}+\frac{1}{b_{1}^{2}}+\cdots \leqslant \frac{1}{b_{1}-1} \leqslant \frac{1}{x}$, i.e., $u+1-v x>0$, thus $X^{\prime} Y^{\prime}-X Y>0$. This means that by the above adjustment, we can increase the intermediate result, which contradicts our assumption about the optimality of the operation process.

Now, we can follow the optimal procedure we have proven to obtain the maximum possible value $A$, and it is easy to see that its last digit is 2.