p153

ok, this doesn't really work -- it's too slow. Translate mindlessly to C
to see the solution in ~10 seconds.