solved with brute force