10
20 MODE1:PRINT:?79=0
30 !80=&4000:!84=&6901
40 A%=&7F:X%=79:Y%=0:CALL&FFF1
50 t%=&C:s%=8:u%=4
60 REPEAT!84=&5303:v%=10:REPEAT
70 w%=s%+u%:IFw%>=10THENw%=10-s%ELSEw%=u%
80 ?86=t%:?87=s%:?88=w%OR32:CALL&FFF1
90 z%=?(?84+86)AND&5F:IFz%THENv%=v%-1
100 UNTILz%=0ORv%=0
110 IFz%THENSTOP
120 s%=s%+w%:IFs%=10THENt%=t%+1:s%=0
130 !80=!80+w%*&100:u%=u%-w%:UNTILu%=0
140 PRINT~!80