Result

AC

Code [DL]

$'d'
 \-(!i!)(i)(i)#

$'i'
 \-i2mc2c(!e!)1a(!c!)0(c)p(c)z1sc(!c!)(!d!)(c)p(e)p#

$'g'
 \-o1s{d}0g#

$'p'
 \-(!d!)-(d){g}\ /-(!Y!)#
       /        v
       | /------/
       \-

$'f'
 \-(!d!)(!c!)(c)(d)2mc2c(!z!)(!y!)(!x!)(y)(d){p}(c)(d)(d)9q-#

$'main'
 \-[00000]{d}p{d}\
                 |
 /{f}-0-\        p
 |    \  >e------/
 ^    | /    \
# \-1a/ |    |
        \-{i}/

stdin

8041550645539902731065278841926269504859195404912107983367866498179555083589043149582507124465697369

stdout

0000000000111111111222222233333334444444444455555555555555566666666667777777888888888899999999999999

stderr

strace