Result

AC

Code [DL]

$'d'
 -(!!)()()#
$'p'
 -(!!)-()o\
   @-/     1
     >g0{d}s-@
    #
$'f'
 -(!!)(!c!)(c)()2mc2c(!z!)(!y!)(!x!)(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

8801551278592087369047787616525499637646341440102844730665895608563099692520671327082242485269480740

stdout

0000000000001111112222222222233333344444444444455555555556666666666666777777777788888888888999999999

stderr

strace