From $a^2+b^2=\frac 12[(a+b)^2+(a-b)^2]$, if we keep $a+b$ fixed and increase their difference $|a-b|$, then $a^2+b^2$ is getting strictly bigger. This is the fundamental operation here - we will ``modify'' pairs $a_i, a_j$, i.e. preserving their sum but increase their difference, to increase $a_i^2+a_j^2$.
Now assume $a_1\geq a_2\geq a_3\geq ...\geq a_n$. We first modify $a_1, a_2$: change $a_1$ to $a_1+a_2-a_3$ and change $a_2$ into $a_3$, by doing this we increase $\sum a_i^2$ while preserving $\sum a_i$ and $a_1+a_2+a_3$. So we can assume $a_1\geq a_2=a_3\geq a_4...$. Next, we modify $a_4$ and $a_n$: increase $a_4$ and decrease $a_n$ until we see either $a_4=a_3$ or $a_n=0$. Next modify $a_5$ (or $a_4$ if we still have $a_4<a_3$) and the last positive term $a_j$... So by doing this, we can assume $a_1\geq a_2=a_3=...=a_{k}\geq a_{k+1}$ while $a_{k+2}=....=0$, and $\sum a_i=3$, and $a_1+a_2+a_3$ remains the same, and $\sum a_i^2$ is larger than the beginning.
Now if $a_1+a_2+a_3$ (that is the biggest $3$-sum) is less than $1$, assume $a_1=1-2\epsilon$, $a_2=...=a_k=\delta$, we get $\delta<\epsilon$. On the other hand $a_1\geq a_2$ implies $1-2\epsilon\geq \delta$. Now
$\sum a_j=1-2\epsilon+(k-1)\delta+a_{k+1}=3$ with $a_{k+1}\leq \delta$. So
$$1-2\epsilon+k\delta\geq 3\geq 1-2\epsilon+(k-1)\delta.$$
So
$$ k-1\leq \frac{2+2\epsilon}{\delta}\leq k.$$
Then compute
$$
\sum a_i^2=(1-2\epsilon)^2+(k-1)\delta^2+a_{k+1}^2\leq (1-2\epsilon)^2+\frac{2+2\epsilon}{\delta}\delta^2+\delta^2.
$$
So $\delta<\epsilon$ implies
$$
\sum a_i^2\leq 1-4\epsilon+4\epsilon^2+2\delta+2\epsilon\delta+\delta^2<1-2\epsilon+7\epsilon^2.
$$
So if $\epsilon< \frac 27$ the above is $<1$ and we get the contradiction. On the other hand, if $\epsilon>\frac 13$, we see $a_1=1-2\epsilon <\frac 13$ and so all $a_i<\frac 13$, so $\sum a_i^2< \frac 13 \sum a_i=1$, again, contradiction.
So now we can assume $\frac 27\leq \epsilon\leq \frac 13$. Now if
$\delta\leq 0.27$, we see
$$
\sum a_i^2\leq (1-2\epsilon)^2+\frac{2+2\epsilon}{\delta}\delta^2+\delta^2
\leq (1-\frac 47)^2+(2+\frac 23)0.27+0.27^2<1,
$$
contradiction. So $0.27<\delta<\epsilon\leq \frac 13$. So
$$
8=\frac{2}{\frac 13}+2< \frac{2}{\delta}+2
<\frac{2+2\epsilon}{\delta}< \frac{2+\frac 23}{0.27}<10.
$$
So $8< k$ and $k-1 <10$, i.e. $k=9, 10$.
The $k=9$ case:
do a further ``modification'' to increase $a_2, .., a_9$
at the cost of $a_{k+1}=a_{10}$, until $a_2=a_3=...=a_9=\epsilon$. If $a_{10}$ is truned into $0$ while
$a_2, ...,a_9$ increases only to $\delta'<\epsilon$, then
$$
3=a_1+...+a_9=1-2\epsilon+8\delta'< 1-2\epsilon+8\epsilon,
$$
we get $\epsilon>\frac 13$, that is not allowed. So EITHER (I) $a_{10}=0$ and $a_2=...=a_9=\epsilon$, then the above argument becomes $3=1+8\epsilon$, which means $\epsilon=\frac 13$, so all $a_j=\frac 13$. We calculate $\sum a_i^2=1$; since now $a_1+a_2+a_3=1$ we do need to do some modifications to turn the original $a_1, a_2, ...$ to this, and during the process the sum of square increased. So for the original $a_1, ...$ we have $\sum a_j^2<1$, contradiction. OR (II) $a_2=...=a_9=\epsilon$ and $a_{10}>0$; in this case
$$
a_1+...+a_9+a_{10}=(1-2\epsilon)+8\epsilon+(2-6\epsilon)=3,
$$
and
$$
\sum a_i^2=(1-2\epsilon)^2+8\epsilon^2+(2-6\epsilon)^2=
5-28\epsilon+48\epsilon^2.
$$
Find maximum of this for $\frac 27\leq\epsilon\leq \frac 13$: we see
this equals $1$ at $\epsilon=\frac 13$, equals $\frac{45}{49}$
when $\epsilon=\frac 27$. Only when $\epsilon=\frac 13$ we have $\sum_i a_i^2=1$, again we need to do some modification to turn the original $a_1, a_2, ...$ to this (i.e. all $a_i=\frac 13$)
so for the original $a_1, a_2, ...$ we have $\sum a_j^2<1$, contradiction.
The $k=10$ case: do a further ``modification'' to increase $a_2, .., a_{10}$
at the cost of $a_{k+1}=a_{11}$, until $a_2=a_3=...=a_{10}=\epsilon$. If $a_{11}$ turns into $0$ before $a_2=...=\epsilon$, this just becomes case $k=9$. Otherwise,
$$
a_1+...+a_{11}=(1-2\epsilon)+9\epsilon+(2-7\epsilon)=3, \ \ \ \
$$
now $a_{11}\geq 0$ requires $\epsilon\leq \frac 27$. If $\epsilon<\frac 27$, we have already
seen $\sum a_i^2<1$. If $\epsilon=\frac 27$, we see $a_{11}=0$ and this is reduced to the $k=9$ case.