Result

AC

Code [DL]

a={case[x],s->x
case[x,*y],s->x+s+a(y,s)}
g={n,x->a(split(x,n)," "+n+" ")}
stdin|{x->a(sort(split(g("0",g("1",g("2",g("3",g("4",g("5",g("6",g("7",g("8",x))))))))))),"")}|puts

stdin

1888273189693926343633086637887463667321886972338694471529187648226719932043995998260713229117405325

stdout

0000111111111222222222222333333333333333444444455556666666666666777777777788888888888889999999999999

stderr

strace