У першому тесті всього є $6$ способів змінити порядок елементів масиву:
\begin{itemize}
\item $a=[1,2,3]$, $s=[\text{'}a\text{'}+1,\text{'}b\text{'}+2,\text{'}c\text{'}+3]=[\text{'}b\text{'},\text{'}d\text{'},\text{'}f\text{'}]=$"$bdf$";
\item $a=[1,3,2]$, $s=[\text{'}a\text{'}+1,\text{'}b\text{'}+3,\text{'}c\text{'}+2]=[\text{'}b\text{'},\text{'}e\text{'},\text{'}e\text{'}]=$"$bee$";
\item $a=[2,1,3]$, $s=[\text{'}a\text{'}+2,\text{'}b\text{'}+1,\text{'}c\text{'}+3]=[\text{'}c\text{'},\text{'}c\text{'},\text{'}f\text{'}]=$"$ccf$";
\item $a=[2,3,1]$, $s=[\text{'}a\text{'}+2,\text{'}b\text{'}+3,\text{'}c\text{'}+1]=[\text{'}c\text{'},\text{'}e\text{'},\text{'}d\text{'}]=$"$ced$";
\item $a=[3,1,2]$, $s=[\text{'}a\text{'}+3,\text{'}b\text{'}+1,\text{'}c\text{'}+2]=[\text{'}d\text{'},\text{'}c\text{'},\text{'}e\text{'}]=$"$dce$";
\item $a=[3,2,1]$, $s=[\text{'}a\text{'}+3,\text{'}b\text{'}+2,\text{'}c\text{'}+1]=[\text{'}d\text{'},\text{'}d\text{'},\text{'}d\text{'}]=$"$ddd$".
\end{itemize}

Лексикографічно мінімальний з цих рядків~--- це "$bdf$".

У другому тесті оптимальний порядок елементів це $a=[26,1,2,4,6]$.