Brute-forcish solution for 236 (runs in 1min30 in python).