Result

AC

Code [DL]

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

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

$'g'
 -o1s{d}#

$'p'
 --(!!)--(){g}\
       /      |
       ^  /g0-/
#(!!)-/ \-

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

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

stdin

1258339953644268322902181141978794241035154206280742016195264160142015995846501674052755739431611770

stdout

0000000000111111111111111122222222222233333334444444444445555555555566666666677777777888888999999999

stderr

strace