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}\ /-(!c!)#
       /        v
       |        |
       \-------/

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

$'main'
 \-[00000]{d}p{d}\
                 |
/(!c!)-----\     p
|           >e---/
0/a1---\ # /    \
|       v  |    |
|       |  \-{i}/
\-(c){f}/

stdin

2419736229915160788122420608722563409969853578297595589431535055698129053234461637275913414889044554

stdout

0000000111111111222222222222333333333444444444445555555555555556666666677777778888888889999999999999

stderr

strace