Result

AC

Code [DL]

a=(0 0 0 0 0 0 0 0 0 0)
while read -s -n 1 C;do $((++a[C]));done
for((i=0;i<10;i++));do
for((j=a[i];j>0;j--));do out+=$i
done
done
echo $out

stdin

7829163640231329775258289940340681963035464629679381979092609563318241640945961834337925094014378075

stdout

0000000000111111112222222223333333333333444444444445555555666666666667777777788888888999999999999999

stderr

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/code.bash: line 2: 1: command not found
/code.bash: line 2: 1: command not found
/code.bash: line 2: 1: command not found
/code.bash: line 2: 1: command not found
/code.bash: line 2: 1: command not found
/code.bash: line 2: 1: command not found
/code.bash: line 2: 1: command not found
/code.bash: line 2: 2: command not found
/code.bash: line 2: 1: command not found
/code.bash: line 2: 1: command not found
/code.bash: line 2: 2: command not found
/code.bash: line 2: 2: command not found
/code.bash: line 2: 2: command not found
/code.bash: line 2: 3: command not found
/code.bash: line 2: 3: command not found
/code.bash: line 2: 2: command not found
/code.bash: line 2: 2: command not found
/code.bash: line 2: 3: command not found
/code.bash: line 2: 1: command not found
/code.bash: line 2: 4: command not found
/code.bash: line 2: 2: command not found
/code.bash: line 2: 2: command not found
/code.bash: line 2: 5: command not found
/code.bash: line 2: 3: command not found
/code.bash: line 2: 3: command not found
/code.bash: line 2: 4: command not found
/code.bash: line 2: 2: command not found
/code.bash: line 2: 2: command not found
/code.bash: line 2: 4: command not found
/code.bash: line 2: 3: command not found
/code.bash: line 2: 3: command not found
/code.bash: line 2: 3: command not found
/code.bash: line 2: 4: command not found
/code.bash: line 2: 3: command not found
/code.bash: line 2: 5: command not found
/code.bash: line 2: 4: command not found
/code.bash: line 2: 5: command not found
/code.bash: line 2: 4: command not found
/code.bash: line 2: 6: command not found
/code.bash: line 2: 3: command not found
/code.bash: line 2: 4: command not found
/code.bash: line 2: 5: command not found
/code.bash: line 2: 5: command not found
/code.bash: line 2: 6: command not found
/code.bash: line 2: 6: command not found
/code.bash: line 2: 6: command not found
/code.bash: line 2: 7: command not found
/code.bash: line 2: 4: command not found
/code.bash: line 2: 7: command not found
/code.bash: line 2: 7: command not found
/code.bash: line 2: 5: command not found
/code.bash: line 2: 4: command not found
/code.bash: line 2: 8: command not found
/code.bash: line 2: 5: command not found
/code.bash: line 2: 9: command not found
/code.bash: line 2: 5: command not found
/code.bash: line 2: 10: command not found
/code.bash: line 2: 7: command not found
/code.bash: line 2: 8: command not found
/code.bash: line 2: 6: command not found
/code.bash: line 2: 11: command not found
/code.bash: line 2: 4: command not found
/code.bash: line 2: 9: command not found
/code.bash: line 2: 8: command not found
/code.bash: line 2: 9: command not found
/code.bash: line 2: 5: command not found
/code.bash: line 2: 6: command not found
/code.bash: line 2: 8: command not found
/code.bash: line 2: 6: command not found
/code.bash: line 2: 6: command not found
/code.bash: line 2: 10: command not found
/code.bash: line 2: 7: command not found
/code.bash: line 2: 7: command not found
/code.bash: line 2: 12: command not found
/code.bash: line 2: 8: command not found
/code.bash: line 2: 5: command not found
/code.bash: line 2: 13: command not found
/code.bash: line 2: 11: command not found
/code.bash: line 2: 7: command not found
/code.bash: line 2: 7: command not found
/code.bash: line 2: 10: command not found
/code.bash: line 2: 9: command not found
/code.bash: line 2: 11: command not found
/code.bash: line 2: 12: command not found
/code.bash: line 2: 6: command not found
/code.bash: line 2: 14: command not found
/code.bash: line 2: 9: command not found
/code.bash: line 2: 6: command not found
/code.bash: line 2: 8: command not found
/code.bash: line 2: 15: command not found
/code.bash: line 2: 10: command not found
/code.bash: line 2: 9: command not found
/code.bash: line 2: 8: command not found
/code.bash: line 2: 11: command not found
/code.bash: line 2: 13: command not found
/code.bash: line 2: 7: command not found
/code.bash: line 2: 8: command not found
/code.bash: line 2: 10: command not found
/code.bash: line 2: 8: command not found
/code.bash: line 2: 7: command not found

strace