Task completed. Brute-force method was used.