At least we know what the solution should look like now, and now we can rewrite it in Python and make sure it works with pypy so it's fast.