···1313 : a; s/aaaaaaaaaa/b/g; t b; b loop
1414 : b; s/bbbbbbbbbb/c/g; t c; b loop
1515 : c; s/cccccccccc/d/g; t d; b loop
1616- : d; s/dddddddddd/e/g; t e; b loop
1717- : e; s/eeeeeeeeee/f/g; t f; b loop
1818- : f; s/ffffffffff/g/g; t g; b loop
1919- : g; s/gggggggggg/h/g; t h; b loop
2020- : h; s/hhhhhhhhhh//g
1616+ : d; s/dddddddddd//g
2117 : loop
2222- /a/! s/[b-h]*/&0/
1818+ /a/! s/[b-d]*/&0/
2319 s/aaaaaaaaa/9/
2420 s/aaaaaaaa/8/
2521 s/aaaaaaa/7/
···3127 s/a/1/
3228 : next
3329 y/bcdefgh/abcdefg/
3434- /[a-h]/ b loop
3030+ /[a-d]/ b loop
3531 # on the last line, print out the answer
3632 $p
3733···5248 s/D/|/g # replace the intermediate "D" marker we used in the loop with '|'
5349 s/.*\n// # get rid of the first line in the current pair
5450 H # put the line in hold space
5555- b outer # and loop
5151+b outer # and loop