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 o+=$i;done;done;echo $o

stdin

5924669045535542056781260904821618360739677846347411591384981467805273735411808321146522980128999398

stdout

0000000011111111111122222222233333333344444444444555555555566666666667777777788888888888899999999999

stderr

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

strace