solve it by brute force