Result

AC

Code [DL]

$'d'
 -(!!)()()#
$'P'
 -(!!){d}o()()1g#
$'p'  #
@-{P}<
  \-s1-@
$'f'
 -(!!)2c(!c!)(!y!)()(y){p}(!P!)(!!)(c)()9()g#
$'g'-i2mc2c(!e!)1a(!!)0()p()z1sc(!!)(!d!)()p(e)p{g}#
 -e<
    #
$'h'  #
 -{f}<
#{h}a1-@
$'main'
 -[00000]{d}p{d}p{g}0{h}#

stdin

4721215984215644132546354702795362943104224994589955355012972443595573277693846300938852036110790002

stdout

0000000000111111112222222222222333333333334444444444444555555555555556666667777777788888999999999999

stderr

strace