Simple brute-force solution for 308 (runs in 20 mins:( ).