Solved p57 - brute force