Result

AC

Code [DL]

while read -n 1 c;do a[c]+=@;done
for i in {0..9};do echo -n ${a[i]//@/$i};done

stdin

4038271015595084382104399162734426483811405929302315823593476479750464656590697695470251764863134216

stdout

0000000001111111111222222222333333333334444444444444455555555555666666666667777777788888889999999999

stderr

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

strace