trees + brute force